Can’t access AWS EC2 instance via public IP but can via SSH

amazon ec2amazon-web-services

I have an AWS EC2 Instance that can be accessed via SSH but will not load via its public IP. The page continually loads and then times out.

I have checked the security group and the following is allowed in luanch wizard 1 (the only security group):

  • HTTP – Port Range 80 – Source 0.0.0.0/0
  • SSH – Port Range 22 – Source 0.0.0.0/0
  • HTTPS Port Range 443 – Source 0.0.0.0/0

Public IP

Any ideas?

Edit* It is an EC2 Instance running Linux, Apache, MySQL and PHP.

Best Answer

The server is accepting connections on port 80 fine:

telnet 52.208.91.148 80
Trying 52.208.91.148...
Connected to ec2-52-208-91-148.eu-west-1.compute.amazonaws.com.
Escape character is '^]'.
^]
telnet>

There is likely an issue in your webserver configuration.

EDIT:

You seem to have a redirect in place in your server config that is redirecting to a server that is not accepting connections:

--2016-10-12 14:42:46--  http://52.208.91.148/
Connecting to 52.208.91.148:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://ec2-52-209-134-209.eu-west-1.compute.amazonaws.com/ [following]
--2016-10-12 14:42:47--  http://ec2-52-209-134-209.eu-west-1.compute.amazonaws.com/
Resolving ec2-52-209-134-209.eu-west-1.compute.amazonaws.com... 52.209.134.209
Connecting to ec2-52-209-134-209.eu-west-1.compute.amazonaws.com|52.209.134.209|:80