参考:
http://www.davidghedini.com/pg/entry/install_tomcat_7_on_centos
http://www.cnblogs.com/panjun-Donet/archive/2010/08/10/1796873.html
设置开机启动:
添加tomcat启动脚本:
[root@srv6 share]# cd /etc/init.d [root@srv6 init.d]# vi tomcat
添加服务:
#!/bin/bash # description: Tomcat Start Stop Restart # processname: tomcat # chkconfig: 234 20 80 JAVA_HOME=/usr/java/jdk1.7.0_05 export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH export PATH CATALINA_HOME=/usr/share/apache-tomcat-7.0.29 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 ;; esac exit 0
设置权限:
[root@srv6 init.d]# chmod 755 tomcat