Can ping ec2 server (ubuntu/apache) but don’t get response from http request

amazon ec2apache-2.2http

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:

Actual Behavior:

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:

tcp    0      0 0.0.0.0:80         0.0.0.0:*         LISTEN      1662/apache2    

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.

Related Topic