Can't access site on EC2 instance via public i

2019-01-29 18:27发布

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.

8条回答
来,给爷笑一个
2楼-- · 2019-01-29 19:23

Very stupid of me as I forgot to install web server (HTTP server) because of which my ec2 instance public IP was not working. Answering this question as this can also be one of the reason which one should not miss as I did.

You can install either,

nginx:

sudo apt-get install nginx

apache2:

sudo apt-get install apache2
查看更多
Deceive 欺骗
3楼-- · 2019-01-29 19:25

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.

查看更多
登录 后发表回答