amazon-web-servicesamazon-ec2apache2ubuntu-16.04

Apache Ubuntu Default Page not Loading


I am working on a new site, and I am spinning up a new server. I have ran into an issue I never have before. After installing LAMP on the server (Ubuntu 16.04), I am not receiving the default Apache Ubuntu page. I am getting this error:

13.59.41.148 took too long to respond.

I have started many servers with LAMP using Digital Ocean in the past, but this is my first time with AWS EC2. Could there possibly be something that I am missing that I have to do with this new host?


Solution

  • Your instance has a public IP assigned already, the issue is the security groups.

    Check the default group, you will have ssh port (22) open to 0.0.0.0/0 which means to the entire world as I was able to hit your instance over IP/22.

    You can use nc utility to check connections[ IP port ]

    nc -vz 13.59.41.148 22
    

    To double check that Apache is loading the default page, you can always ssh to the server and curl localhost

    curl localhost:80
    

    Simply add network rule to the security group allowing 80 from 0.0.0.0/0 if you wish to have traffic opened to everyone.

    However, better solution after the testing phase would be to setup Load Balancer in front of ec2 hosting the website. That Ec2 would be then hosted in private network, and traffic would be forwarded from Load Balancer hosted in public network.

    You should probably also limit access over 22 to only your IP/network.

    have a read on security groups basics: AWS docs - Security groups