Can't get HTTP connection to Amazon Web Services EC2 Windows Server 2012 Instance

2

I have an Amazon Web Services EC2 instance with a Windows Server 2012 AMI on it. I have installed XAMPP on it, and have started the apache server from the XAMPP Control Panel. It starts successfully.

Also in the AWS Dashboard, I have added rules to the relevant Security Group for the Instance, as detailed in linked image (I don't have enough reputation yet to post an image):

AWS EC2 Instance Security Group Settings

I have replaced the actual source ip setting for the inbound traffic with xxx.xxx.xxx.xxx/32 in this image, but it is set to the ip from which I am trying to establish the http connection, so I am not sure why I am unable to establish an http connection? I have also tried allowing inbound HTTP traffic via port 80 from all sources, by specifying ip 0.0.0.0/0, same problem.

I am trying to establish the http connection via my browser, simply by using the AWS instance public dns/ip, e.g.

http://myAWSinstancedns.compute.amazonaws.com

or

http://myAWSinstancedns.compute.amazonaws.com/xampp/splash.php

When try the same thing from within the AWS instance, using localhost, it works, but not from outside.

Anyone any idea?

user2606742

Posted 2014-09-13T01:52:02.793

Reputation: 123

Answers

0

  1. Create a second instance on the same subnet and on the same security group and see if you can access the http server. If so that points to security group or ACL issues. If not, then
  2. Check if the http server accepts connections on 0.0.0.0/0 or only 127.0.0.1 (localhost). One allows it to accept only local connections while other allows it to accept incoming connections.

Perennial

Posted 2014-09-13T01:52:02.793

Reputation: 91

0

Sounds like Apache may be configured to only accept connections from the local host. Have you tried accessing the website from the hosting server via the public address? Also, for testings sake, I would probably put the 0.0.0.0/0 rule back into place until you figure out the issue. Simplicity!

Spencer5051

Posted 2014-09-13T01:52:02.793

Reputation: 301

Hi Spencer, thanks for your response. I have changed the http rule to allow connections from anywhere, as you suggested, for testing. Anyway, from within the instance, I am able to connect via the public dns as well. But from outside, still not able to connect. – user2606742 – 2014-09-13T20:06:15.293

Just an update, I also posted on aws forums, and was suggested to check if the instance is running a firewall, which it is, so I turned it off. But I still cant connect from outside. Also, I ran netstat -anp tcp | find ":80" and got this output, so it seems it is listening: C:\Users\Administrator>netstat -anp tcp | find ":80" TCP 0.0.0.0:80 0.0.0.0:0 LISTENING TCP 172.31.34.244:49397 199.193.196.18:80 CLOSE_WAIT TCP 172.31.34.244:50988 169.254.169.254:80 CLOSE_WAIT – user2606742 – 2014-09-13T20:19:11.830

aha, I had only turned off the firewall for the domain profile, not for the public profile. Now it works! – user2606742 – 2014-09-13T20:26:39.997

Just for completeness, I now turned the firewall back on, but created a rule to allow communication via port 80 for http and another port for my BOSH service. – user2606742 – 2014-09-13T20:32:38.773