tomcat在ubuntu中设置开机启动
2017-04-21 12:09
344 查看
#!/bin/bash export JAVA_HOME=/usr/lib/jdk/jdk1.7.0_72 WEBROOT_PATH=/home/zhengze/workspace WEBSERVER_PATH=$WEBROOT_PATH/web-server/apache-tomcat-6.0.41 STARTUP_SHELL=$WEBSERVER_PATH/bin/startup.sh SHUTDOWN_SHELL=$WEBSERVER_PATH/bin/shutdown.sh case "$1" in start) sh $STARTUP_SHELL ;; stop) sh $SHUTDOWN_SHELL ;; restart) sh $SHUTDOWN_SHELL sh $STARTUP_SHELL ;; esac
1.新建文件tomcat.sh,将上面内容写入文档。JAVA_HOME,WEBSERVER_PATH依据实际情况填写。
2. cp tomcat.sh /etc/init.d/tomcat
3.sudo sysv-rc-conf tomcat on
检查tomcat启动设置:
直接进/etc/rcX.d中。也能发现以S开头的tomcat的启动项。
这里多讲一点,S开头的启动项表示开机启动。K开头的表示开机不启动。
4.假设要取消开机启动,sysv-rc-conf tomcat off
假设要启动项要删除tomcat,sysv-rc-conf tomcat remove
5.重新启动机器。
检查tomcat是否真的在监听port:
netstat -nltp|grep <tomcatport>
6.你最终能够以以下的方式管理tomcat了。
启动:/etc/init.d/tomcat start
关闭:/etc/init.d/tomcat stop
再也不用去一层一层文件夹里找startup.sh或者catalina.sh了。
相关文章推荐
- ubuntu 14 中tomcat的开机启动设置
- tomcat在ubuntu中设置开机启动
- ubuntu设置自定义程序开机启动(本文以tomcat为例)
- ubuntu设置自定义程序开机启动(本文以tomcat为例)
- Ubuntu 设置 Tomcat 开机启动
- Ubuntu下设置tomcat为服务(开机启动)
- ubuntu下tomcat开机启动设置
- Linux:设置Tomcat开机启动
- ubuntu双系统开机默认启动windows设置
- ubuntu设置IBus开机启动
- ubuntu + windows 双系统设置开机默认启动的系统
- Windows下设置Tomcat6开机启动
- Ubuntu 10.04LTS 设置开机/登录自动启动应用程序
- Centos6.0 tomcat-6.0.33设置开机启动
- ubuntu设置开机启动应用程序
- linux:设置tomcat开机自动启动
- ubuntu设置开机启动图形应用程序,替换默认图形桌面
- ubuntu下设置tomcat成为启动服务
- Ubuntu 10.04设置开机启动到字符界面
- ubuntu10.04设置 ibus开机启动