Ubuntu – Why can I not connect to jetty webserver on Ubuntu within AWS EC2 instance

amazon ec2amazon-web-servicesjettyUbuntu

Unable to connect from my webbrowser to my Jetty Server running on Ubuntu Linux SMP in Amazon Webservices EC2.

I can connect using localhost whilst logged in from the machine itself

i.e curl http://localhost:8080/?type=release\&query=reid:1

works

Because this is an Amazon EC2 instance it has both a private and a public ip, when I start jetty it says

 * Starting Jetty servlet engine, jetty8                                              
 * Jetty servlet engine started, reachable on http://ip-172-31-16-219:8080/. jetty8 

But ip-172-31-16-219 relates to my private address not my public address, however from the computer itself using the dns for the private ipaddress still fails

curl http://ip-172-31-16-219.eu-west-1.compute.internal:8080/?type=release\&query=reid:1

I have read that the problem might be iptables firewall, but iptables does is not a known command on this instance (maybe not used by ubuntu)

For testing purposes I have configured the Amazon security group it uses to allow full inbound and outbound

What else do I need to do ?

Best Answer

I suspect you want to be using the "Public IP" and/or "Public DNS" of your server, rather than the "Private IP" or "Private DNS". You can see all of these in the "Description" tab of the instance on the EC2 dashboard.

The Private DNS compute.internal domain name will only be meaningful if you are using Amazon-provided DNS. I don't know any reason that you'd particularly want that however.

More information: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html