Milksnake12
Milksnake12

Reputation: 561

Connecting to at-home server from web

I have a CentOS server at home that I'm trying to put a website on. I put the index.html in the /var/www/html/ folder and can access it from another computer on the local network (with 'http://192.168.etc'). The problem comes when I try to access it from the web with my ip (http://34.52.xx.xx). I turned off iptables when I tried to access it to rule out a firewall issue with no success. I use Comcast and read that they sometimes block port 80 so I edited the /etc/httpd/conf/httpd.conf to listen on port 8000 in addition to 80 incase port 80 was blocked (httpd restarted after changes). When I enter 'http://myIP:8000' with iptables down I still don't get my page to show up.

What am I missing?

Thanks!

Upvotes: 0

Views: 511

Answers (1)

Pat
Pat

Reputation: 2700

You surely have one public IP address let say 34.52.01.01 and you surely have “several” private IP addresses 192.168.1.1/192.168.1.2 ...

Between both worlds there’s a layer in your router call NAT (Network Address Translation) that allows a request started from let say 192.168.1.2 to reach the external world (let say google.com), when the external world provides an answer for such a request it's your router NAT who knows that that answer must be routed back to 192.168.1.2

But if you have a request originated in the exterior world pointing to 34.52.01.01 you do not have an HTTP server on that address then you need in your router some forwarding rule saying let say if you receive a TCP request in port 80 route it to 192.168.1.5 that is the internal address of your HTTP server…

You need to add port forwarding to your router…

Upvotes: 1

Related Questions