Skip to content

Instantly share code, notes, and snippets.

@mortenbra
Last active August 29, 2015 14:22
Show Gist options
  • Save mortenbra/03bd91afed91415df393 to your computer and use it in GitHub Desktop.
Save mortenbra/03bd91afed91415df393 to your computer and use it in GitHub Desktop.
Setup Tomcat service script to start at boot time
# assumes you have created a service script at /etc/init.d/tomcat
cd /etc/init.d/
# make the script executable
chmod 755 tomcat
# set to start at boot time
chkconfig --add tomcat
chkconfig --level 234 tomcat on
# verify it
chkconfig --list tomcat
# start tomcat
service tomcat start
# note: this gave error "Cannot find /usr/share/tomcat7/latest/bin/catalina.sh
# The file is absent or does not have execute permission"
# see http://louis-sawtell.com/content/tomcat-cannot-find-bincatalinash
cd /usr/share/tomcat7/latest/bin
chmod +x *.sh
chmod +x *.jar
# stop tomcat
service tomcat stop
# restart tomcat
service tomcat restart
# check logfile and look for any errors
cat /usr/share/tomcat7/latest/logs/catalina.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment