Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have public IP 89.103.xxx.yyy, then router and home network with 192.168.1.zz My router is set to portforward every 8056 on ip adress 192.168.1.5 (my PC), where apache is running. Apache listen is set to:

Listen 127.0.0.1:80
Listen 192.168.1.5:8056

When i try:

Listen 89.103.xxx.yyy:8056

I get message "unexpected end of apache" (I'm using easyphp for windows).

Added: When i try to access 89.103.xxx.yyy via browser, it's prompting router request for authorization to access router web-settings. And when i try 89.103.xxx.yyy:8056, browser says that connection timed out =(

share|improve this question
    
Check firewall settings as well. –  MrStatic Mar 14 '10 at 19:13
    
My only windows fireawall is off =) –  Filip Mar 14 '10 at 19:15
    
AV software will also have firewall... –  marcusw Mar 15 '10 at 0:05

3 Answers 3

up vote 5 down vote accepted

You'll need to configure apache to listen on 192.168.1.5:80 (on 192.168.1.5, the requests will arrive on port 80. not 8056). Also make sure that on the router port 8056 is forwarded to 192.168.1.5 port 80

share|improve this answer
    
I dont have settings in my router webconfigurator to portforward on specified port =( .. just: Local IP Address - Protocol - Port Range –  Filip Mar 14 '10 at 19:16
    
What's you router make and model ? You can also try to use wireshark on your windows computer to make sure on which port the HTTP requests are received. –  Dominik Mar 14 '10 at 19:24
    
I have ZCOMAX WA 2204 and i have uPNP enabled. There are "Ping Access on WAN" and "Web Server Access on WAN" options as well, enabled too. –  Filip Mar 14 '10 at 19:31
    
I set 192.168.1.5 with my apache to DMZ and still nothing =( –  Filip Mar 14 '10 at 20:00
    
Access to 192.168.1.5:8056 from my notebook that is in same "home" network is working just fine even when listen is set to "Listen 192.168.1.5:8056", ping to my 89.103.xxx.yyy is forking fine and port 8056 on my 89.103.xxx.yyy is opened assuming info from ping.eu –  Filip Mar 14 '10 at 20:25

You do not need to change the port Apache is listening at all! In my case, Apache listens at port 80 normally.

You must:

  1. Configure all routers and modems (some modems have an internal router, such as DLINK) to receive some unusual ports as '8081' to '8082' AND redirect those requests to the IP where your apache server is running, at the port 80. Avoid to use 8080, 8081 or higher.

  2. Put the hosts (both networks) in the DMZ (host at "DEMILITARIZED ZONE", in other words, out of policies)

There are 2 networks in my case:

  • 10.1.1.1 (modem)
  • 192.168.1.1 (wireless router)

Example:

Suppose a modem router whose network is 10.1.1.1 and the Apache PC is AT 10.1.1.5. You must configure NAT - Virtual Servers acessing 10.1.1.1 / NAT / Virtual Servers:

PortStart......PortEnd......type....... dest IP........ dest PORT
...8081..........8082........TCP...... 10.1.1.5............... 80

DMZ Host: 10.1.1.5 ← the UP used by the Apache PC network. To get it, run ipconfig at cmd prompt.

For the secondary router (wireless) whose network is 192.168.1.1: DMZ Host: 192.168.1.10 ← IP of the PC running Apache in the wireless router subnet.

To preview the site, do not use your home wireless or or a computer connected to your home network, because all you will see is the modem's router page. You must access your site from outside the home network (ex: use your mobile GSM internet, never WiFi).

The scheme to access the site, so, lets suppose the current internet IP is 199.123.4.75:

  • http://199.123.4.75:8081 or
  • http://199.123.4.75:8081/mywebsite

  • http://199.123.4.75:8082 or

  • http://199.123.4.75:8082/mywebsite

Remember, Apache is still listening at port 80. Who does the magic are the routers, especially the first (modem) that redirects the ports. NAT – Virtual Servers. DMZ is also essential. For both router configurations.

share|improve this answer

Turn off the "Web Server Access on WAN" option.

change the port forward "range" to just be 80.

change apache back to "Listen 192.168.1.5:80"

share|improve this answer
    
This may not work as many ISPs block incoming port 80... –  marcusw Mar 15 '10 at 0:52
    
quote the OP "Added: When i try to access 89.103.xxx.yyy via browser, it's prompting router request for authorization to access router web-settings. " –  user23307 Mar 15 '10 at 2:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.