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

So I have a java web app on tomcat installed on the server. How can I setup auto start for it so that it starts up automatically when the server is restarted?

share|improve this question

migrated from Feb 1 '10 at 14:04

This question came from our site for professional and enthusiast programmers.


# Provides:          tomcat-wepappname 
# Required-Start:    $all 
# Required-Stop:     
# Default-Start:     2 3 4 5 
# Default-Stop:      0 1 6 
# Short-Description: foo bar 
# Description:       long desc
# Author: Foo Bar <> 

. /lib/lsb/init-functions 

# Actions 
case "$1" in 
  log_action_begin_msg "Starting tomcat webapp" "tomcat-webappname"
  su - tomcat-webappuser -c "/home/sites/tomcat-webappname/ $1" 
  log_end_msg 0 
  su - tomcat-webappuser -c "/home/sites/tomcat-webappname/ $1" 
# restart) 
# something else...
#  ;; 

exit 0

At least, register the service:

update-rc.d activemq defaults
share|improve this answer
i guess it should be : update-rc.d tomcat-wepappname defaults – Daniel T. Magnusson Mar 19 '13 at 9:41


/sbin/chkconfig tomcat6 on

If you have installed the tomcat6 RPM.

share|improve this answer
No man I'm using SUSE Enterprise Linux 9 here – Daud Ahmad Feb 2 '10 at 5:21
up vote 0 down vote accepted

Found this article here that did it for me.

share|improve this answer
broken link.... – Daniel T. Magnusson Mar 19 '13 at 9:33
Link updated... – Daud Ahmad Mar 20 '13 at 10:54

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.