If you only download the comcat zip/tar, use following step to operate the tomcat as a service
1 Create /etc/rc.d/init.d/tomcat :
#!/bin/sh
#
# /etc/init.d/tomcat
#
# This is the init script for starting up the
# Jakarta Tomcat server
#
# description: Starts and stops the Tomcat daemon.
#
tomcat=YOUR_TOMCAT_PATH
startup=$tomcat/bin/startup.sh
shutdown=$tomcat/bin/shutdown.sh
start() {
echo -n {1}quot;Starting Tomcat service: "
sh $startup
echo $?
}
stop() {
echo -n {1}quot;Stopping Tomcat service: "
sh $shutdown
echo $?
}
restart() {
stop
start
}
status() {
ps -aef | grep apache-tomcat | grep -v tomcat6 | grep -v grep
}
# Handle the different input options
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
restart
;;
*)
echo {1}quot;Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0
Edit the lines that start with tomcat and export to match where you installed tomcat and your jdk.
Note: I can't remember where I first got the original version of this script so if you deserve credit for this, let us know.
2. Add execute access to the script, so run:
chmod a+x tomcat
chkconfig --add tomcat
4. Restart linux and use the following command to start/restart/stop the tomcat
service tomcat start
service tomcat restart
service tomcat stop