2

I have a problem with starting Jetty via the startup command /etc/init.d/jetty. When I execute the command the following output is generated:

/etc/init.d/jetty start

Starting Jetty servlet engine.: 
Jetty Rotate logs
Jetty servlet engine started, reachable on http://jagadguru:80/.: jetty.

It does start successfully when I type java -jar start.jar in my Jetty directory.

Can anyone help me with this?

Perception
  • 79,279
  • 19
  • 185
  • 195
Michael Stark
  • 635
  • 2
  • 9
  • 17

3 Answers3

1

This is likely a file permission issue. Even if you are running the start script with sudo, the script defines a jetty user (default is jetty). I had an issue similar to this where my permissions on /tmp prevented jetty from creating a file there. I adjusted the permissions on /tmp and all is well! The jetty user also needs permissions on the jetty folder of course.

Also, for checking if Jetty is finding java correctly, run sudo service jetty check

Eric B.
  • 11
  • 3
0

It's probably an issue due to wrong permissions on some work or log folder. I assume the start script tries to change the user and therefore doesn't has the same permissions as the one you use when running Jetty via "java -jar".

Another possibility is that you don't have JAVA_HOME set and the start script doesn't find your java bin.

Please attach some kind of log file as it is really hard to say more without more detailed information.

Dario Pedol
  • 2,070
  • 14
  • 24
  • My question would be what to log, considering that if jetty fails to start then there will be no logs written. – fabspro Sep 13 '12 at 17:05
  • I have the same issue. If $JAVA_HOME is not set, the script does not start and explicitly says that $JAVA_HOME is not set. As for the permission issue, I'm running it with 'sudo' doesn't solve the problem – dm76 Nov 25 '12 at 10:41
  • 1
    @fabspro, the log would be in /var/log/jetty – dm76 Nov 25 '12 at 10:44
0

As answered here, the default configuration for Jetty in /etc/default/jetty only allows connections from localhost, you need to set JETTY_HOST to 0.0.0.0 to allow Jetty to accept connections from any host.

Add the following line to /etc/default/jetty:

JETTY_HOST 0.0.0.0
Community
  • 1
  • 1
Vitaly Olegovitch
  • 3,509
  • 6
  • 33
  • 49