5

I'm trying to install jetty in an Amazon EC2 instance running Ubuntu. The installation seems OK

$ sudo apt-get install jetty

After that I made the parameter NO_START=0 in /etc/default/jetty

Finally

$ sudo service jetty start
    Starting Jetty servlet engine. jetty
    Jetty servlet engine started, reachable on http://ip-xx-xxx-xxx-xxx:8080/
    ...

Nevertheless, when I write in the browser (external computer):

 http://ec2-xxx-xx-xx-xx.compute.amazonaws.com:8080 

The browser could not connect to the address using the given port. I don't know if something is missing during the installation or the URL is wrong.

Thanks for your time and help :-) ,
- Carolina

Nishant
  • 54,584
  • 13
  • 112
  • 127
user968175
  • 51
  • 1
  • 2
  • When you are on the instance, does this connect: telnet localhost 8080 – Eric Hammond Sep 28 '11 at 01:44
  • @EricHammond : I do curl http://localhost:8080/ and I get the expected response. Yet, when I try from an external machine it doesn't work. I should note that I also installed an ubuntu VM on a Win7 guest machine, and I have the exact same problem. – Dan Feb 21 '12 at 08:12
  • I don't know Jetty, but some applications like MySQL and Apache have to be told to listen on more than just localhost. – Eric Hammond Feb 23 '12 at 21:24

2 Answers2

3

Each instance on amazon has a security group assigned to it. In the AWS console, select the instance and the security group is shown in the lower pane. Then select security groups on the left and select the group for that instance from the table. In the lower tab, select inbound, these are the IPs addresses/ports allowed in. If 8080 isn't allowed, that's your problem, you need to add it. Enter 8080 in the port range box and 0.0.0.0/0 for the source. Then "add rule" and make sure you "apply rule change" lastly.

Frodo Baggins
  • 8,290
  • 6
  • 45
  • 55
  • 1
    I have the exact same problem. However opening the 8080 port on the security group had no effect. What else could be the problem ? – Dan Feb 21 '12 at 08:08
1

I found the answer here: Jetty (mis)configuration: it wont respond from an external machine... why? You need to change /etc/default/jetty to have JETTY_HOST=0.0.0.0

Community
  • 1
  • 1
fratrik
  • 1,700
  • 2
  • 15
  • 17