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


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 ?


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


It looks like it's basing the output it gives based on your hostname, so check what's in /etc/hostname and if it's wrong change it to something more appropriate.

However, the hostname won't actually be needed to connect, you should just be able to connect to the public IP address that you have given the instance on port specified (8080 in this case)

Also make sure the firewall rules are correct in the Amazon EC2 console and are allowing 8080 from the outside world.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.