分类: LINUX
2008-08-28 17:43:30
以root用户登录系统:
cd/etc/rc.d/init.d/
vitomcat
文件内容参考如下:
#!/bin/sh##tomcat:Start/Stop/Restarttomcat##chkconfig:23458020#description:TomcatisaJavaServletContainer###matchthesevaluestoyourenvironment:exportCATALINA_BASE=/usr/local/tomcatexportCATALINA_HOME=/usr/local/tomcatexportCATALINA_TMPDIR=/usr/local/tomcat/tempexportJRE_HOME=/usr/java/jdk15#Sourcefunctionlibrary../etc/rc.d/init.d/functionsTOMCAT=/usr/local/tomcatstart(){echo-n$"StartingTomcat:"$TOMCAT/bin/catalina.shstart}stop(){echo-n$"StoppingTomcat:"$TOMCAT/bin/catalina.shstop}#Seehowwewerecalled.case"$1"instart)start;;stop)stop;;status);;status);;restart)stopstart;;*)echo$"Usage:$0{start|stop|restart}";;esacexit$RETVAL
把tomcat修改为可运行的文件,命令参考如下:
chmoda xtomcat
使用chkconfig命令把tomcat命令加入到系统启动队列中:
chkconfig--addtomcat
查看apachectl的状态:
chkconfig--listtomcat
好了,全部完成