After Tomcat 5.5 is installed, it is very easy to decompress the downloaded package and put it in the corresponding directory. Then, after setting environment variables such as JAVA_HOME and CATALINA_HOME in the Linux environment, run the command in the bin directory of Tomcat. /catalina. sh run can start the tomcat service in the terminal mode. To add tomcat to the self-starting queue, perform the following operations:
Log on to the system as a root user:
Cd/etc/rc. d/init. d/
Vi tomcat
The file content is as follows:
#!/bin/sh## tomcat: Start/Stop/Restart tomcat## chkconfig: 2345 80 20# description: Tomcat is a Java Servlet Container### match these values to your environment:export CATALINA_BASE=/usr/local/tomcatexport CATALINA_HOME=/usr/local/tomcatexport CATALINA_TMPDIR=/usr/local/tomcat/tempexport JRE_HOME=/usr/java/jdk15# Source function library.. /etc/rc.d/init.d/functionsTOMCAT=/usr/local/tomcatstart() {echo -n $"Starting Tomcat: "$TOMCAT/bin/catalina.sh start}stop() {echo -n $"Stopping Tomcat: "$TOMCAT/bin/catalina.sh stop}# See how we were called.case "$1" instart)start;;stop)stop;;status);;status);;restart)stopstart;;*)echo $"Usage: $0 {start|stop|restart}";;esacexit $RETVAL
|
Modify tomcat to a running file. The command is as follows:
Chmod a + x tomcat
Use the chkconfig command to add the tomcat command to the system startup queue:
Chkconfig -- add tomcat
View the status of apachectl:
Chkconfig -- list tomcat
Well, it's all done. It's a simple record. Hope to help you and let me remember it!