Apache Web Server Works Locally Not Globally

1

I have been at this for a while tonight and thought I would seek some help before I hit the sack. I have successfully downloaded Apache and can run it without any issues on a fedora 16 box acting as the web server. I was able to make pages that can be viewed locally.

To summarize

From the Fedora Box I can access my pages via a web browser at

  • 127.0.0.1 as well as its local IP address.

From a windows box on the same home network I can access the page from

  • its local IP address.

From both machines I can successfully ping the global IP address (provided by whatsmyip.org)

As far as I know the issue seems to be at the router. I had to reload a backup twice tonight because I kept breaking stuff (Remember folks, saving is FTW). Could any of the following issues with the router or web server be the problem? The following list sums up what I have attempted and whats enabled at the moment.

  • Currently the router has NAT enabled.
  • The router firewall is disabled
  • I have attempted port forwarding of port 80. I used the web server local address as the forward port
  • HTTP has been enabled in the linux firewall on the web server
  • The internet comes into the house as follows
    • ISP Provided Modem >> My personal Router >> Individual Device

Edit: According to my ISP Port 80 is blocked in the following fashion. Could this pose a bigger problem or is RedGrittyBrick's answer a way around it

  • Port = 80
  • Transport = TCP
  • Protocol = HTTP
  • Direction = Inbound

sealz

Posted 2012-01-13T05:56:48.673

Reputation: 2 034

on which device have you enabled port forwarding? – daya – 2012-01-13T06:02:09.177

@daya On the router. And in case anyone is curious its an EnGenius ESR9850 – sealz – 2012-01-13T06:14:08.620

Answers

1

Port forwarding

When you set up port forwarding, you need to have three parameters correct:

  • the external port, usually 80 for HTTP.
  • the internal IP-address of the server, often 192.168.1.x
  • the internal port for HTTP service on the internal server, again usually 80.

ISP port blocking

Note that a web-server on an ADSL line will have poor performance and may break the terms of your ISP service - for this reason your ISP might block incoming traffic. Try setting the external port to a high number (e.g. 30080) leaving the internal port at 80 then give an external browser a URL http://<external IP>:30080/

RedGrittyBrick

Posted 2012-01-13T05:56:48.673

Reputation: 70 632

After some additional research it seems that my ISP may block port 80. Would I set the external port in the httpd.conf file? I have tried 123.123.123.123 as well as 123.123.123.123:80. – sealz – 2012-01-13T12:12:32.700

Or would this be more along the ligns of what I need: http://rootatwc.com/blog/article/1

– sealz – 2012-01-13T12:23:41.293

@harper89: No the external port is set in the router's port-forwarding configuration. The port number of the internal web server can remain the same. This is sometimes called Port Address Translation (PAT). If your router can't do PAT as part of port-forwarding then and only then would it be necessary to change the port the webserver listens to (in which case you can make it listen to two port numbers for convenience: 80 AND 30080 say) – RedGrittyBrick – 2012-01-13T12:23:51.573

@harper89: that blog article applies if your router is very basic and lacks port-forwarding on a per-port basis. – RedGrittyBrick – 2012-01-13T12:26:12.380

Thanks I will play around with it after work, someone else +1 him again for me. – sealz – 2012-01-13T12:28:44.200

Thanks I fixed the router settings and it works perfectly. Still being funny on devices other than the web server itself but i should be able to take it from here – sealz – 2012-01-15T06:54:31.840

2

I am assuming your issue is that you cannot access the web server from its public address from the local network - from the same network that the server resides on.

This is because most domestic routers do not support hairpinning, which is the technique of doing the double nat / unnat that is required to manage the connection going in and out of the same interface.

When you are pinging the global address, it is most likely the router that is responding, not the web server.

Considering using split DNS to access the server, where internally the dns name resolves to the private address, and externally resolves to the public address.

Paul

Posted 2012-01-13T05:56:48.673

Reputation: 52 173