Background:
- OS: ubuntu
- Web Server: apache2
What works:
- I can ping the server's elastic IP (and receive a response)
- I can ssh into the server
What doesn't work:
- I cannot get any sort of http response from the server
Expected Behavior:
- When I go to http://ec2-XXX-XX-XXX-XXX.compute-1.amazonaws.com/, it will serve my page, or at least give me a 404 that I can debug
Actual Behavior:
- When I go to http://ec2-XXX-XX-XXX-XXX.compute-1.amazonaws.com/, it says "Oops! Google Chrome could not connect to ec2-XXX-XX-XXX-XXX.compute-1.amazonaws.com". It doesn't even give me a 404.
Rant:
Clearly the server is there because I can ssh in to that exact address and I can ping that exact IP and get a response. But when I go that exact address in my web browser it's as if it never makes it to the server. Or it's as if Amazon isn't letting http requests through, but in my security group I am clearly specifying that http requests from all sources are allowed through. Apache is definitely running, my document root is definitely set up properly, and my error and access logs don't give me anything.
Is there any sort of log in between Amazon and the server, or in between requests making it to the server and being received by Apache that would specify why it's returning "not found" rather than a 404. Can I make my Apache logs more verbose?
Thanks in advance! I've spent hours on this….
Best Answer
If you are getting connection refused from
telnet
output, this means you are connecting to a closed port on your server.You have a line in
netstat -lnp
that reads:If your apache is listening on different port, you need to specify that port in the URL like:
http://ec2-XXX...com:8080/
if the port is 8080.