Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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....

share|improve this question
    
Did you check DNS? Did you try to use nslookup ec2-XX-XX... or dig or any name resolution tool? Did you get the same IP address? –  Khaled May 24 '12 at 7:13
    
nslookup ec2-XXX-XX-XXX-XXX.compute-1.amazonaws.com will return the ip address so it seems that is working. I can also do nslookup sub.mydomain.com and it returns the same ip address. –  arasmussen May 24 '12 at 7:15
    
If you try telnet your_ip 80, what do you get? –  Khaled May 24 '12 at 7:17
    
Is port 80 open in your firewall rules? –  B14D3 May 24 '12 at 7:18
    
So if I do telnet XXX-XX-XXX-XXX 80, it says "telnet: Unable to connect to remote host: Connection refused". However, my security group in Amazon's ec2 settings clearly says to allowed traffic through on 80. Might be worth mentioning that I'm trying this from cygwin, but I'm guessing it should be the same. Also, when I run "netstat -net" on the server (ssh'd in) I get the following line: "tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN" –  arasmussen May 24 '12 at 7:20

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
My apache files were set to Listen 8080 instead of Listen 80... –  arasmussen May 24 '12 at 7:40

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.