Your ISP may block port 80 (like mine) to stop you from hosting web pages. More on this in a moment.
There are two ways to make your computer accessible to incoming connections (i.e. browsers looking at your webpage).
- Forwarding just port 80 (the safe way)
- Becoming the DMZ host (the dangerous way)
Becoming the DMZ host (can't remember what it stands for...) tells the router to forward
all incoming connections to your computer. This means every internet service you have running on your computer will be exposed and will be accessible to anyone. This can be dangerous. The safe way is to tell the router to forward all connections to port 80 to your computer.
This process varies on different brand routers.
To access and configure your router you will need to access it via it's web-based interface. This is done by connecting to it in Netscape or Konqueror. You need to know the IP address of the router to do this.
Some routers use 192.168.0.1, some use 192.168.1.1, some use 10.0.0.1 etc. When you connect to the router you will be presented with an authentication window. Again, different routers have different usernames/passwords. I myself have a Linksys router, the default username is nothing (no username), and 'admin' as the password.
Consult your router documentation for specifics on the default IP address it uses as well as the authentication information.
Once you see the router configuration you should look for 'Advanced' setup or 'Port Forwarding' or something to that effect. If your router has an advanced page, you will need to locate 'Port Forwarding' on that page.
Here you will be able to enter the IP addresses on your local network to forward the connections to, as well as a place to enter the port range forwarded. you will want to enter your computer's local IP address and just enter port 80.
It's important to note that if you are using DHCP to retrieve IP addresses for the computers on your local network, you may have trouble with the port forwarding system, as your IP may change when you reboot or your computer reconnects to the router. If this is the case, you may need to use a hostname if your router supports it, or switch to static IP addresses).
If you don't know your computer's local network IP address you will need to open up a terminal and type
# /sbin/ifconfig
Note: In Redhat (at least in RH 9) you do not need to 'su' to be the root user to run ifconfig.
Probably under the connection 'eth0' your connection will be directly after 'inet addr:'.
To make sure it works, type your global IP address into your browser. If you see the Apache test page then your good to go. If you get 'Connection Refused' make sure Apache is running. If it is, and it works by entering '
http://localhost' in your browser, Port 80 may be blocked by your ISP. In this case, you will need to change the port Apache uses to serve pages. To do go to the Redhat menu->System Settings->Server Settings->HTTP Server and under the 'Available Addresses' group box click Add. Click 'Listen to all available addresses' and change Port to 8080 or 81 or whatever you want to use (be careful you aren't using some other services main port, just in case you ever decide to use those services). Click Ok, then Click OK in the main Apache Configuration window. I'm not sure if Redhat restarts httpd. If not, open up a terminal and type
# su
Password: <root pass>
# /etc/rc.d/init.d/httpd reload
That will tell Apache to reread it's configuration and reload itself. Again, enter your global IP address into your browser, but now append ':8080' (without the quotes) or whatever your port was that you added. If you see the test page, *now* your done
. If not, your ISP is psycho or port forwarding is not working properly. Try making yourself the DMZ host, you'll see it in the router prefs.