Can't access site on EC2 instance via public ip Can't access site on EC2 instance via public ip ruby-on-rails ruby-on-rails

Can't access site on EC2 instance via public ip


Did you enable the http port to all ips? That would be done by going to:

EC2 -> Security Group -> Default (or your custome one) -> Inbound

And then Create a new rule for HTTP and as a source, you should assign: 0.0.0.0/0

That should do it.


Think the AWS UI may have been updated but based on Deleteman's answer

  • Login to EC2 Dashboard
  • Instances > Instances
  • Actions dropdown > Networking > Change security groups
  • You will probably see that you only have launch-wizard-1 allowed which for me only allowed SSH access on port 22

So as Deleteman mentions, you may need to alter your security groups...

  • Login to EC2 Dashboard
  • Network and Security > Security Groups
  • Remove any filters that may be in the search box to show all groups
  • Personally I edited the default VPC security group as this is a sandbox for me, I imagine you'll want to create a security group for your project
  • Select the security group checkbox, select actions dropdown and click "edit the inbound rules", I used the following inbound rules just to be sure it was all working

Rules

  • When you revisit Instances > Instances > Description, you should see the security groups and the rules

enter image description here

  • Once you are happy it's working I would probably replace all traffic with HTTP and HTTPS if that's all that is needed


I was here earlier looking for a solution to a similar problem I was having. It turns out in my case that the EC2 instance also had its own firewall running in addition to the EC2 security group. The command 'system-config-firewall' let me get in to open the ports. Ports 80 (HTTP) and 3306 (MySQL) were not open by default. 22 (SSH) was open. I also had to do 'yum install system-config-firewall'.

To summarize, my solution was:

> yum install system-config-firewall> system-config-firewall