错误:Cannot find /etc/bin/setclasspath.sh 或service tomcat does not support chkconfig
解决方法:
#cp /usr/java/apache-tomcat-7.0.67/bin/catalina.sh /etc/init.d/tomcat ///复制到开机启动目录
# vim /etc/init.d/tomcat ///编辑
将下面四行加入文本里(注意有两行是带#号,两行不带的,注意tomcat和jdk修改成你的路径)
#chkconfig: 2345 10 90
#description:tomcat service
CATALINA_HOME=/usr/java/apache-tomcat-7.0.67
JAVA_HOME=/usr/java/jdk18071
# chmod +x /etc/init.d/tomcat ///赋予执行权限
# chkconfig --add tomcat ///添加到服务列表中
# chkconfig --list | grep tomcat ///查看服务列表中是否添加成功
# chkconfig tomcat on ///设置开机启动
# netstat -an | grep 8080 ///查看8080端口是否开启,开启了代表启动成功
手动启动、停止
# /etc/init.d/tomcat stop 或 # /etc/init.d/tomcat start
# service tomcat start 或 #service tomcat stop
错误:start: unrecognized service
解决方法:是不是命令写反了service start tomcat,应该是 service tomcat start
参考:
http://blog.csdn.net/greensurfer/article/details/7440375
本文转自 piazini 51CTO博客,原文链接:http://blog.51cto.com/wutou/1760912