Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to set up a web server for my first time. I'm running Ubuntu 12.04.1 and i've installed LAMP. I have also set up a static IP for the server, 192.168.0.111 and reserved it in the router settings. So far so good.

Now to the problem. I forwarded port 80 to the servers IP address, but the server is not responding to any connections. If i try to access the public IP through a webbrowser when the port is NOT forwarded, i get an error saying "Could not connect to host". If i do forward the port i get a timeout error. Correct me if i'm wrong, but that should mean the port is being forwarded to the server, but what happens after that i don't know. Am i right? And any suggestions about how to troubleshoot this?

EDIT: I should also mention that Apache does in fact work and if i type in 127.0.0.1 in a browser, the page does indeed load. I just can't access it from the outside world.

share|improve this question
    
Look into /var/log/apache2/ access and error logs. –  carandraug Sep 1 '12 at 22:37
add comment

2 Answers

up vote 0 down vote accepted

I found the problem, and in fact, there was no problem. I just couldn't access the website through my public IP from my own IP, I could only access it from other IPs. I'm guessing there is some security block in my router that prevents it. To fix it I set up a virtual server instead of forwarding a port (as recommended in the D-link forums). The result is the same; the port is forwarded to the server, but now I can also access it from the network. It was as simple as that.

share|improve this answer
add comment

You have to use an outside IP address to be able to check the forwarding. Forwarding on most routers is only for incoming traffic, not for stuff that originates on the inside. You can use tor to make sure your requests come in from outside.

share|improve this answer
add comment

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.