Windows – Can’t access site on EC2 instance via public ip

amazon ec2windows

I have Amazon EC2 micro instance with window 2008 server and deployed one sample web application over there which uses java and deployed on tomcat 7 server. I am able to access it locally on instance, but when I tried to access it outside of AWS instance lets say from my home computer using AWS public DNS / public IP address/ Elastic IP address of the instance, it gives me "Web page is not available".

I have gone through so many similar questions in this forum and i think i have done all the setting they are asking to do, but still no success.

Here is what I have done/confirmed.

1. localhost works, so application listens on port 80.

2. added inbound rule for HTTP on port 80 for everyone under the security group that my instance is using.

3. checked firewall setting on windows instance, made sure port 80 is not blocked.

4. tried even with turn off firewall, but no success.

I would really appreciate if some one can help me on this.

Thanks,
NS

Best Answer

I had a similar frustrating problem when I installed JetBrains YouTrack on a Windows Server 2012 ec2 instance. What worked for me was opening the Windows firewall ports that java was using specifically and disabling the World Wide Publishing service port. I also had to run the YouTrack service under the LocalSystem account instead of the default account.

Try this:

  • Turn off the default website in IIS if it is in use

  • Run a netstat -a -b to discover the ports the java.exe was attempting to bind to e.g:

    TCP 0.0.0.0:80 WIN-9NFIG6IEPT6:0 LISTENING [java.exe]

    TCP 127.0.0.1:49306 WIN-9NFIG6IEPT6:49307 ESTABLISHED [java.exe]

  • Open the service control manager and right click on your service and open the properties dialog. On the Log On As tab select Local System Account as the account the service runs under. It's important that this user be Administrator

  • I highly recommend turning the firewall back on.
  • Open the firewall Inbound rules tab and disable the World Wide Web Services (HTTP-In) Rule
  • Create a new rule for Tomcat with TCP Port 80 and any other port it might need.

  • Save the rule and test your url from outside the server.

Related Topic