Linux – Port 80 not accessible Amazon ec2

amazon ec2amazon-web-serviceslinuxSecurity

I have started a Amazon EC2 instance (Linux Redhat)…
And Apache as well.

But when i try:

http://MyPublicHostName

I get no response.

I have ensured that my Security Group allows access to port 80.
I can reach port 22 for sure, as i am logged into the instance via ssh.
Within the Amazon EC2 Linux Instance when i do:
$ wget http://localhost
i do get a response. This confirms Apache and port 80 is indeed running fine.

Since Amazon starts instances in VPC, do i have to do anything there…
Infact i cannot even ping the instance, although i can ssh to it!

Any advice?

EDIT:
Note that i had edited /etc/hosts file earlier to make 389-ds (ldap) installation work.

My /etc/hosts file looks like this(IP addresses as shown as w.x.y.z )
127.0.0.1   localhost.localdomain localhost
w.x.y.z   ip-w-x-y-z.us-west-1.compute.internal
w.x.y.z   ip-w-x-y-z.localdomain

Best Answer

By default the RedHat firewall blocks some ports, including port 80. This is in addition to the Firewall configured on Amazon AWS through the Security Group.


You can customize the firewall to allow your HTTP traffic.

$ sudo system-config-firewall-tui

firewallhttpconfigforredhat

Another option is to disable the internal firewall all together. However, make sure you know what you're doing.

Related Question