3
3
I am trying to make my home server accessible to the whole web. I have installed Nginx on my Fedora 15 64-bit Linux machine, and it works with localhost but it doesn't work online or allow other computers on the network to access it via the IP address. It keeps coming back with:
Could not connect
I have port forwarding. I have even tried different ports but they all seem to be blocked. What could be wrong? I have a netgear router.
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
REJECT all -- anywhere anywhere reject-with icmp-host- prohibited
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host- prohibited
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
What model Netgear router EXACTLY? – KCotreau – 2011-08-06T14:22:10.667
Its a N600 Wireless Dual Band Router, Model WNDR3400, and my web server is Nginx 0.8.54 – Qasim – 2011-08-06T14:24:30.760
Can you access it from your internal network from another computer using the IP address? How are you determining your external IP address? Do you have a static IP or DDNS? – KCotreau – 2011-08-06T14:25:00.913
I have a dynamic IP address, but I can put it to static if I need to. I can access using localhost (my machine ip is 172.16.0.15) but it doesnt work if I try to access it from my netbook using that machine IP. – Qasim – 2011-08-06T14:26:19.213
Still not sure how you are trying to access it. From the netbook, you put in http://172.16.0.15 not http://localhost right? If you try http://172.16.0.15 and you cannot get to it, then it is probably some kind of local firewall in the way. When I said Static or DDNS, I meant your external IP address, not your internal. Ultimately, if you do want to access it from the outside, you will probably want to give it a static IP as that is easier to port forward to, although some newer routers can also map DHCP changes and correctly forward.
– KCotreau – 2011-08-06T14:34:24.117Yes I put in 172.16.0.15 with no luck on other devices connected to the same network. I'm not sure of any firewalls, what kind of firewall but block it? – Qasim – 2011-08-06T14:40:04.397
1There has to be some kind of firewall on your Linux box that is blocking you. At first, I thought it was a general how-to question, but now we have a specific, and frankly, I am not qualified to answer it. I would ask another question, like "My Fedora 15 Linux machine seems to be blocking port 80. How do I configure this to allow port 80 access from other computers?" After that, you can try to move on, and maybe come back to this question. – KCotreau – 2011-08-06T14:45:14.327
1In broad strokes, you need to get your home firewall/router to allow incoming connections on http (i.e. port 80) and you need it to send traffic it receives on port 80 on to your home server. Specifically, how to do that is highly dependent upon the brand and model of your home router. – golliher – 2011-08-06T12:17:25.870
Please add the output of iptables -L to your question (from the server running nginx), also, have you got nginx correctly configured to listen on port 80 on all interfaces, not just localhost? – EightBitTony – 2011-08-06T14:51:44.530
Before you go any further you need to post the output of this command:
netstat -ln | grep 80
. This will tell you on which interfaces your server is listening. This is check number 1 in the whole process, because you need to make sure it listens to your public interface, and not just to the local loopback interface. – Casper – 2011-08-06T15:23:48.840if I am not mistaken, port forwarding is needed only for access from the internet. I don't think you need to forward ports to grant access to computers on a local network. I might be wrong. – Baha – 2011-08-06T15:53:10.713