0

I havent been able to find a solution to my particular problem.

I have a MAC which I set up as a web server and configured my router to forward to the local IP. When trying to access my site from outside, it does say "It works!", however, when I call a simple Hello World PHP script that I have, I am getting an error that the page could not be opened. I did enable PHP on my machine so thats not the problem.

I really have no idea how can I access - I followed so many tutorials and did everything correctly. My router is a Linksys WRT160N if it matters at all. In the port forwarding section, I selected to forward

5
  • Check the server logs for any relevant errors. The error you described is not helpful in debugging the problem. What do you get if you try to telnet to the server IP/port? Also, can you retrieve the same page locally?
    – Khaled
    Nov 11, 2011 at 13:54
  • how do i get a server log? i am a total newbie with this. and yes, when i am on the local network (WiFi), i can run the PHP script.
    – TommyG
    Nov 11, 2011 at 13:57
  • Does it work with the internal IP? Nov 11, 2011 at 13:57
  • what do you mean internal IP? thats the setup - when I am on the local network (via WiFi), i can access this: 192.168.1.102 and 192.168.1.102/hello.php from all my devices (2 MAcs and one iphone). when i go outside, i can access this: 192.168.1.102 but not this: 192.168.1.102/hello.php
    – TommyG
    Nov 11, 2011 at 14:00

3 Answers 3

1

that isn't your external IP (192.168.1.102), this is an internal network IP. anything starting with 192.168.. is relative to your local netowrk. go to www.ipchicken.com to get your external IP, then try that IP with hello.php.

this should work if IP forwarding is working correctly with your router set up.

1

If you are outside of your network you won't be able to access 192.168.1.102. 192.168. is an IP subnet specifically reserved for routers and other internal networks, that IP cannot be accessed outside of your home network.

One solution you could try is using a firewall to target traffic to the computer with the IP 192.168.1.102, then when you try to access your server externally you use the IP of your network, you can find it using something like http://www.whatsmyip.org/

1
  • Well billy ! wget -O - ip-details.com | grep 'Your IP is' | sed -e 's/.* is //' -e 's/ .*//'
    – user202662
    Dec 16, 2013 at 12:06
1

Most routers won't NAT if your requests comes from the inside interface.

So you type in the outside IP and it won't get translated back to the inside IP if you do this from a PC in your own network.

Not the answer you're looking for? Browse other questions tagged .