为了让tomcat自动启动当电脑重起时, 你必须添加一个脚本, 使其能自动启动或关闭tomcat
To make tomcat automatically start when we boot up the computer, you can add a script to make it auto-start and shutdown.
sudo gedit /etc/init.d/tomcat7
Now paste in the following:
添加下面文字
# Tomcat auto-start
#
# description: Auto-starts tomcat
# processname: tomcat
# pidfile: /var/run/tomcat.pid
case $1 in
start)
sh /usr/share/tomcat7/bin/startup.sh
;;
stop)
sh /usr/share/tomcat7/bin/shutdown.sh
;;
restart)
sh /usr/share/tomcat7/bin/shutdown.sh
sh /usr/share/tomcat7/bin/startup.sh
;;
esac
exit 0
修改权限使其执行
You’ll need to make the script executable by running the chmod command:
sudo chmod 755 /etc/init.d/tomcat7
最后一步就是创建一个链接文件在启动目录, 执行下面两条语句
The last step is actually linking this script to the startup folders with a symbolic link. Execute these two commands and we should be on our way.
sudo ln -s /etc/init.d/tomcat7 /etc/rc1.d/K99tomcat
sudo ln -s /etc/init.d/tomcat7 /etc/rc2.d/S99tomcat
Tomcat should now be fully installed and operational. Enjoy!
这个时候TOMCAT应该是能运行了
sudo /etc/init.d/tomcat7 restart
分享到:
相关推荐
加入系统启动任务,可以监测tomcat运行情况,当tomcat停止服务时,可以自动启动tomcat
tomcat设置为开机自动启动的服务项tomcat设置为开机自动启动的服务项tomcat设置为开机自动启动的服务项tomcat设置为开机自动启动的服务项
Centos7安装配置tomcat 9并设置自动启动, 具体参考链接地址, https://blog.csdn.net/stinkstone/article/details/78082725 ,这里是连接的配置文件。
Tomcat 7 Windows中以Service方式启动配置启动参数
配置tomcat启动到window服务中,window开机自动启动tomcat
Linux自动启动tomcat服务shell脚本
tomcat自动启动服务,可以将tomcat设置成服务,可以开机自启动
linux下自动启动tomcat的shell脚本
Java环境变量配置和tomcat自动启动、Java环境变量配置和tomcat自动启动、Java环境变量配置和tomcat自动启动、Java环境变量配置和tomcat自动启动、Java环境变量配置和tomcat自动启动、Java环境变量配置和tomcat自动...
centos设置tomcat开机自启动
ubuntu linux 下apache与tomcat的整合.txt
ubuntu linux下安装tomcat
主要介绍了Ubuntu下配置Tomcat服务器以及设置自动启动的方法,适用于Java的web程序开发,需要的朋友可以参考下
Ubuntu环境下 Tomcat服务 自启动脚本编写及实现方式
让tomcat自动启动 让tomcat自动启动
通过A服务器自动登录其他服务器自动传输文件、删除文件、自动检测tomcat启动状态,控制启动和停止、可配置多条服务器进行同步处理,适合集群管理
绿色版 tomcat如何做成windows 自动启动的服务
tomcat 开机启动,dos窗口去掉,tomcat 开机启动,dos窗口去掉
文档总结了使用简单shell脚本实现开机自动启动tomcat的方法
在ubuntu系统中安装jdk、tomcat. 在ubuntu系统中安装jdk、tomcat. 在ubuntu系统中安装jdk、tomcat.