Unable to access site in EC2 instance using public ip

I experimented with EC2 for several days, and I hit my head, even being able to access the sample that I posted. The stack is Rails 3.1.3 with Thin and Nginx.

I tried several different configurations and finally finished running the unattended installation of the Nginx script, which returns a web page when I make a curl http://ec2-107-20-143-179.compute-1.amazonaws.com/ , however When I point my browser there, it hangs forever before saying that the page was not found.

I assigned Elastic an IP address and I enabled HTTP access through port 80.

I am not very good at sysadmin, and now I'm basically a dead end. Any advice would be greatly appreciated.

+56
ruby-on-rails amazon-ec2 nginx
Apr 20 '12 at 21:00
source share
8 answers

Have you enabled the http port for all ips? This will be done if:

EC2 β†’ Security Group β†’ Default (or your custome is one) β†’ Inbox

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

That should do it.

+114
Apr 20 2018-12-21T00:
source share

Think that the AWS interface may have been updated, but based on Deleteman's answer

  • Entrance to the EC2 control panel
  • Instances> Instances
  • Drop-down menu Actions> Network> Change Security Groups
  • You will probably see that you only have run-master-1, which for me only allowed access to SSH on port 22

As Deleteman mentions, you may need to change your security groups ...

  • Entrance to the EC2 control panel
  • Network and Security> Security Groups
  • Remove all filters that may be in the search box to show all groups.
  • Personally, I edited the default VPC security group, because for me it is a sandbox, I suppose you want to create a security group for your project.
  • Check the security group box, select the drop-down list of actions and click "change incoming rules", I used the following incoming rules to make sure that everything works.

Rules

  • When you review instances> instances> Description, you should see security groups and rules

enter image description here

  • Once you are happy that I am working, I would probably replace all HTTP and HTTPS traffic if that’s all it takes
+35
Dec 03 '14 at 13:21
source share

I have been here before, looking for a solution to the problem that I am facing. It turns out that in my case, the EC2 instance also had its own firewall, which works in addition to the EC2 security group. The "system-config-firewall" command allows me to open ports. Ports 80 (HTTP) and 3306 (MySQL) were not opened by default. 22 (SSH) was opened. I also had to run "yum install system-config-firewall".

To summarize, I decided:

> yum install system-config-firewall > system-config-firewall 
+25
Jul 20 2018-12-12T00:
source share

This answer is for beginners who have no idea what they are doing with the ec2 instance.

I had the same problem and tried all security group fixes to no avail.

As it turned out, I needed to turn on my server from the command line.

 sudo service httpd start 

Sometimes it is dark, not because the fuse has exploded, but because you did not click the switch.

+18
May 7, '13 at 16:39
source share

I also struggled with the same problem that I created the security group, but did not apply to the instance. Just create a new rule for http. And apply with a right-click and select a security group and assign it.

+6
Apr 13 '14 at
source share

Octopus's answer was correct for me, with the exception of the Windows machine. I needed to go to the Windows firewall, blocked all traffic from the VM, if it did not comply with the rule. Port 80 was not included in the rule, so I just had to add it.

+3
Nov 27 '13 at 4:16
source share

It is very stupid with me when I forgot to install a web server (HTTP server), because of which my normal ec2 IP address did not work. Answering this question, as this may also be one of the reasons why you should not miss, like me.

You can install either

Nginx:

 sudo apt-get install nginx 

apache2:

 sudo apt-get install apache2 
+1
Dec 08 '15 at 16:29
source share

I had the same problem, I had a brain, since I have no experience with Ubuntu or linux. Parag's answer fixed this.

It is very stupid with me when I forgot to install a web server (HTTP server), because of which my normal ec2 IP address did not work. Answering this question, as this may also be one of the reasons why you should not miss, like me.

You can install either

Nginx:

 sudo apt-get install nginx 

apache2:

 sudo apt-get install apache2 
0
Jun 25 '17 at 18:31
source share



All Articles