Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am installing tomcat on a linux server, and would want it to be available as a service. I have found two different ways to achieve this.

The first one is to copy the from $CATALINA_HOME/bin to /etc/init.d, and the other one I have seen is to create a simple init script that class $CATALINA_HOME/bin/, etc. calls

The contents of the and look very similar (at least for the env variables, and stuff like that). calls jsvc in the end. calls java.

What is the (practical) difference between using the two of these when setting up tomcat as a service?

share|improve this question
up vote 1 down vote accepted

I always set up Tomcat environments with Apache HTTPD in front of it, serving as a proxy server for the Tomcat backend.

Ports below 1024 are privileged ports. Basically, this means that if you run Tomcat directly using catalina/startup/shutdown you will need to run as root, to bind to 80 or 443 (SSL).

jsvc will enable you to run the Tomcat itself as a non-privileged user and only create the listener as privileged user.

I have never deployed a setup that uses jsvc. I have written a simple init.d script that starts Tomcat on a "service account", and then I let mod_proxy(_ajp) talk to it from Apache. That way, you can make your tomcat listen locally on a non-privileged port, and let Apache do what it's good at.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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