Running Apache through a router

Posted:
in Genius Bar edited January 2014
Here is the short version of my problem: I have Apache up and running with my web site, and I can access it from my home network, but I cannot access it from the Internet. I have a cable modem and a Belkin router.



Any help is greatly appreciated. Below is a much more detailed explanation of my problem and what I've done to try to solve it (unsuccessfully).



======



I'm trying to run a small personal web site using MacOS X and Apache. This is just for fun. And for the learning experience. However, I cannot figure it out.



I have a cable modem and a Belkin router. My WAN (real) IP address is 24.193.52.227 and my Belkin router IP address is 192.168.2.1 and my Apple MacOS X computer's IP address is 192.168.2.2.



Now, Apache works fine on my home network, but it cannot be accessed from the Internet. In other words, I can reach my Apache web site with http://192.168.2.2 or with http://127.0.0.1 but not with http://24.193.52.227.



I've been reading up on some articles, and they say to configure my router to use port forwarding, which I did. Unfortunately, the Belkin router uses port 80 because it has an Internet HTTP set up utility. In other words, going to http://24.193.52.227 will bring up the Belkin router configuration utility, not my web page. The Belkin router will not allow me to forward port 80 because it says it interferes with its set up utility (which is understandable, seeing as there is no other way to configure it).



So, I read some more articles, and they said to use a different port. So I forwarded TCP 24.193.52.227:8080 to 192.168.2.2:80 which I thought would forward http requests on port 8080 to my computer running MacOS X and Apache. However, if I go to http://24.193.52.227:8080/ absolutely nothing happens.



I'm sorry for the length of this message, but I wanted to make sure you understood my question, and understood what I had already tried.



Any help is greatly appreciated!



One more thing, my cable modem ISP does allow web page hosting, because I can reach my Belkin router configuration utility through the Internet. To me, that signals that the problem is on my end, and that I'm doing something wrong.



I tried putting my computer into the DMZ, but nothing changed. I turned off all Firewalls and still nothing. I changed httpd.conf to Listen 24.193.52.227:8080 but nothing happened.



The only thing I haven't tried is plugging my computer directly into the cable modem, which isn't an option because I have multiple computers.



Philip

Comments

  • Reply 1 of 1
    ebbyebby Posts: 3,110member
    EDIT: Didn't read your entire post.



    Lets see, you can access your web server on http://192.168.2.2:8080 so clearly Apache is working. Your router must be the source of the problem. I must assume your IP address is current. And port 8080 is forwarded to your Macs IP address. That all sounds right. BUT I am not detecting any open ports.



    What kind of Belkin router do you have?



    Old post:

    Quote:

    You can't forward one port to another. 8080 will look for 8080 on your computer.



    You need to configure apache to use 8080 instead. Download OnyX if you don't have it already. Choose Appearance->Show hidden files and folders. Click apply.

    Open your hard drive and follow: /etc/httpd/ Open the file httpd.conf with a text editor and change the port number from 80 to 8080. Save and Uncheck "Show hidden..." in OnyX. Click apply and log out then back in. Everything should work if your OS X firewall is off.



Sign In or Register to comment.