How host Webserver from Outside Network - apache

I have subscribed to Local Broadband plan in Delhi, They have 1 static ip through which their all subscribe use it. When I Enter my ip from outside then it will forwarded to their Local IP management Software Page. How can i access to my web server, Is there my port forwarding technique like through unique port i can access to my localhost from out side or any other way. Even Dynamic DNS service like no-ip isnt working. they all are landing on same IP Management page.
Thank You in Advance.
Note: Using Nginx on Raspberry Pi.

The problem is with your Local Broadband company. Sounds like they need to do the port forwarding, or you from that "management page" you get to access.
You have to be able to forward port 80 from your router (the one with the Public Static IP) to the private (NAT) IP of the PI; both on port 80.

Related

Raspberry pi web server from internet

I have been trying to make an access to my Apache server on Raspberry Pi from internet for several days.
I set up Apache, PHP, mySQL, myadmin and put index.php to 'www' folder
I edited dhcpcd.conf to set static IP.
interface eth0
static ip_address=192.168.1.220/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
I registered mydomainname.net on no-ip.net for my internal IP address
Installed No-IP Dynamic Update Client on raspberry pi and it's status is active
I opened port 80 on my router for static IP Address of my RASPBERRY (192.168.1.220)
On my router I added my no-ip account and it shows status 'Success'
I even tried to change Apache listened port from 80 to 8090
But, whatever I do, I can't get access to mydomainname.net from internet, but I can do it from my local network on my static Raspberry IP - 192.168.1.220.
So the problem is the IP you are using is your internal IP. This IP is inaccessible from the outside. As long as you are inside your network you can use the internal IP adress tho.
try using https://www.canyouseeme.org/ to obtain your router IP adress maybe then you'll be able to acces it trough IP already. also this is the IP that you need to register on the host of your site.

How to access my static ip from outside network?

I bought a Static IP from my ISP, in router config in dmz i set static IP to my pc ip (which runs an apache tomcat), I can reach the tomcat server from inside the network but it's not accessible from outside, what shoud i do?
better than use DMZ is using port forwarding on your router. You can set only :80 opened and after this, it should be working.
Also, do you have your public IP configured on your router, or your router have on WAN port some internal IP of ISP?
If you have internal IP on WAN, you need setting up firewall rules to this WAN IP, not to your Public.

Can't see site externally

I'm brand spanking new to setting up websites, so go easy.
Basically I setup an osticket system on my XAMPP stack and It works locally no problem but when I try to access it from my public IP it won't connect.
I've port forwarded port 12345 -> 80 as my server listens on 80.
So theoretically if I type in my URL bar it should connect right?
In the httpd.conf file for Apache do I enter the external or internal IP address? I'm assuming I leave it as localhost because the .conf file is local to the server.
My networking setup:
Firewall setup:
<PublicIP:12345> ALLOW <PriavteIP>
Port forwarding setup:
<PublicIP:12345> -> <PrivateIP:80>
It's hard to tell without understanding more about your setup. I'm going to assume you have a router that connects your internal network to the Internet, and you have one or more computers connected in your network, and your server is one of those.
So are you talking about the port forwarding rules on your public-facing router's firewall? If you are forwarding port 12345 from your router to port 80 on your server, the reason it won't work is because a standard HTTP request from a public machine will come to your router on port 80, not port 12345. Are you entering in a URL with the 12345 port number in it? If anything, you should simply be routing all requests to port 80 on your router to the IP of your server.
You can check this if you try to view your web site using the port number in the URL. So if your IP address to your router is 5.6.7.8 you would enter http://5.6.7.8:12345 and this would load your web page, as the request for a page from port 12345 would get forwarded to port 80 on your server. But honestly I think you just need to get rid of port 12345.

how to set up xampp as online server?

I'm using xampp as a testing host, but I want to be able to access it from anywhere. currently I can access it through localhost only, and through lan by typing my local ip, but not by typing my external ip from anywhere. I tried setting up apache vhosts, but I'm not sure what to put there, examples online aren't very clear, and I don't even know if it works. so if someone could give me a heads up, I'd appreciate!
Log into your router and set up port forwarding to your computer with xampp on it. You probably want to forward port 80 (default for http) to your computer's LAN IP. Then you should be able to access your xampp setup over the Internet by going to your external IP address.
first you need to make sure the incoming traffic on port 80 is not blocked by your firewall or ISP - see this video demo
then you need to configure your Router to forward:
incoming requests to your External IP port 80 towards your Internal IP port 80 - video demo here
and finally test if port open - see this demo

Apache: how can I access my webpage from a computer outside my network?

I want to access my webpage from a computer outside the network. Our network has IPs like 192.168.0.1-192.168.0.255. The network is connected to Internet through a local gateway 192.168.0.1 and gets to DNS server 193.xxx.xxx.xxx.
Let's say my computer has the IP 192.168.0.50. How can I my website from my server (Apache) from a computer which is not from our network (let's say 254.231.52.xxx)?
Thank you!
Short answer:
The solution to this would be to find out the 'external IP' of your router and enable a port forwarding for port 80 and 443 to your local IP.
Long answer:
The Internet is divided into 'public' and 'private' IP spaces. Private IPs are usually not directly accessible from a 'public' IP.
The IPs from the 192.168.0.1-255 are from one of these private subnets.
Your router (at home) usually has multiple IPs. One or more from your local private network (192.168.0.X) and one from your local ISP (I guess something like 193.xxx.xxx.xxx because your DNS is in that network) which is from the 'public' space.
To connect to your computer with the private IP from a public IP like the mentioned 254.231.52.xxx you would have to connect to the public IP of your router (the 193... one). You would also have to enable a mechanism that is called 'port forwarding'. This effectivley takes all internet traffic arriving at the public IP of your router on the forwarded ports and transfers it to the private IP you configured the forwarding to.
E.g. 254.231.52.. -> 193...:80 -> 192.168...:80
Usually home routers have a configuration page where you can do this.
The required ports you would probably use are 80 (http) and 443 (https).
Another possibility is using so called http-proxies which are also usually supported as a configuration option one home routers. You should refer to the manual of your router for configuration instructions of this.
What you need is to identify your home computer from the whole internet in order to access from outside.
This tutorial can help you
http://kyokasuigetsu25.wordpress.com/2011/01/21/how-to-access-localhost-of-computers-outside-the-network/
But if you only have plain html files ( css, js too ) you could use Dropbox and share your sites folder. This way you could be working locally and files would be synced to your public folder
Hope it helps
If you have sufficient privilege to configure the router (on the gateway machine), then you can use "port forwarding" to do that.
Go to your router settings and configure it so that it forwards the packets it receives on port 80 to your machine. Assuming your router has a valid IP itself (say x.x.x.x) you can access your Apache server on: http://x.x.x.x/.
You can use any other port instead of 80 and access your Apache through http://x.x.x.x:PORT/ of course.
If you don't have sufficient privileges, then nothing comes to my mind except using reverse tunneling using SSH or similar protocols.
Most gateways (router) have an VirtualServer option which you can point to the local server (192.168.0.50)
You could use something like dyndns.org to setup a permanent hostname to your server. i.e. mylocalserver.dyndns.org
A public name for your machine needs to be set up in DNS to point to your networks' router. Then you will need to set up your router to redirect traffic for that name to the machine in question. Also the firewall needs to be set up to allow that.