Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't access site on EC2 instance via public ip

I've been experimenting with EC2 for a couple days and have been banging my head against simply even being able to access the sample site I've hosted. The stack is Rails 3.1.3 with Thin and Nginx.

I've tried several different configurations and finally ended up running the Nginx auto install script, which does return a webpage when I do a curl http://ec2-107-20-143-179.compute-1.amazonaws.com/. However, when I point my browser there, it hangs forever before saying the page cannot be found.

I have assigned an Elastic IP address, and I've enabled HTTP access via port 80.

I don't much experience with the sysadmin side and I'm basically stumped at this point. Any advice would be greatly appreciated.

like image 580
primer Avatar asked Apr 20 '12 21:04

primer


People also ask

How do I access my EC2 instance with a public IP?

Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . Select an AMI and an instance type that supports IPv6, and choose Next: Configure Instance Details. On the Configure Instance Details page, for Network, select a VPC and for Subnet, select a subnet. For Auto-assign IPv6 IP, choose Enable.

Why can't I access my EC2 instance?

Verify that your instance is ready Check your instance to make sure it is running and has passed its status checks. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . In the navigation pane, choose Instances, and then select your instance.

Does an EC2 instance need public IP to reach internet?

For accessing internet from EC2 instance in public subnet using Internet Gateway, the instance needs to have public IP address. Either one can configure the instance to have public IP address or attach EIP.


1 Answers

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.

like image 58
Deleteman Avatar answered Oct 14 '22 23:10

Deleteman