步驟和配置oracle的自啟動相似,不過是腳本不同。
步驟如下
[1]touch /etc/init.d/tomcat6
[2]vim /etc/init.d/tomcat6
內容如下:
#!/bin/sh
#tomcat auto-start
#
# description: Auto-starts tomcat
# processname: tomcat
# pidfile: /var/run/tomcatpid
export JAVA_HOME=/opt/jdk1.6.0_18
export CATALINA_HOME=/opt/apache-tomcat-6.0.18
case $1 in
start)
sh $CATALINA_HOME/bin/startup.sh
;;
stop)
sh $CATALINA_HOME/bin/shutdown.sh
;;
restart)
sh $CATALINA_HOME/bin/shutdown.sh
sh $CATALINA_HOME/bin/startup.sh
;;
*)
echo 'Usage:tomcat start|stop|restart'
;;
esac
exit 0
[3]chkconfig --add tomcat6
[4]chkconfig --edit tomcat6
內容為
tomcat6 on
[5]chkconfig --list tomcat6
tomcat6 0:off 1:off 2:on 3:on 4:on 5:on 6:off
至此設置完畢。
|----------------------------------------------------------------------------------------|
版權聲明 版權所有 @zhyiwww
引用請注明來源 http://m.tkk7.com/zhyiwww
|----------------------------------------------------------------------------------------|
posted on 2010-01-29 13:13
zhyiwww 閱讀(1102)
評論(0) 編輯 收藏 所屬分類:
linux