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

So, I just set up my first LAMP server. I think.

I followed this guide and then proceeded to connect to it using Filezilla, so that means that it exists, at least.

I made an index.html and placed it inside /var/www/html

However, when I enter in my Elastic IP address or the public DNS and try to navigate to it, my browser tells me that it can't connect.

How can I find out where I went wrong, and fix it?

I saw that I should provide this information from my concurrent Googling:

 sudo iptables --list -n -t nat                   
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         

There ports are open on the Security Groups tab:

20 - 21     0.0.0.0/0   
22 (SSH)    0.0.0.0/0   
80 (HTTP)   0.0.0.0/0   
1024 - 1048 0.0.0.0/0   
share|improve this question

1 Answer 1

up vote 0 down vote accepted

You most likely don't have port 80 open in your instance's security groups. Check this link for more details: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html

One other thing you can verify is if apache listening on port 80? Check you Apache configuration or run "netstat -anp | grep 80" as root. Also, make sure your Apache virtual host has your Elastic DNS name (or whatever DNS address you're using to access the server) either as the ServerName or a ServerAlias.

share|improve this answer
    
I replaced NameVirtualHost *:80 with NameVirtualHost [the-ip]:80 and that didn't work. I also ran netstat -anp and that didn't seem to help. Do I need to restart apache for the changes to take effect? –  Houseman May 14 '13 at 21:46
    
Also, I updated my question to include information about my security groups –  Houseman May 14 '13 at 21:46
    
Yes, I restarted apache (it told me httpd was not running, and that it would start it), then it worked –  Houseman May 14 '13 at 22:07

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.