thinkhk 发表于 2015-8-11 12:55:58

tomcat的自动启动-再次冲击Ubuntu之server篇

  tomcat的自动启动还是比较麻烦的,在网上找了个貌似最简单的:http://kejun.javaeye.com/blog/432956
  就是用sysv-rc-conf来管理自启动程序,然后编写/etc/init.d下面的脚本tomcat:


1 export JAVA_HOME=/usr/lib/jvm/java-6-sun
2 case $1 in
3 startup)
4 sh /opt/tomcat5/bin/startup.sh
5 ;;
6 shutdown)
7 sh /opt/tomcat5/bin/shutdown.sh
8 break
9 ;;
10 restart)
11 sh /opt/tomcat5/bin/shutdown.sh
12 sh /opt/tomcat5/bin/startup.sh
13 ;;
14 *)
15 sh /opt/tomcat5/bin/startup.sh
16 ;;
17 esac
18 exit 0  最后用sysv-rc-conf tomcat on来设置自启动,sysv-rc-conf tomcat off来取消。
页: [1]
查看完整版本: tomcat的自动启动-再次冲击Ubuntu之server篇