Linux设置Tomcat服务开机启动
来源:互联网 发布:python控制继电器代码 编辑:程序博客网 时间:2024/06/05 17:48
1、生成启动脚本文件
vi /etc/rc.d/init.d/tomcat
文件内容:(记得修改标红的参数)
#!/bin/bash## /etc/rc.d/init.d/tomcat# init script for tomcat precesses## processname: tomcat# description: tomcat is a j2se server# chkconfig: 2345 86 16# description: Start up the Tomcat servlet engine.if [ -f /etc/init.d/functions ]; then. /etc/init.d/functionselif [ -f /etc/rc.d/init.d/functions ]; then. /etc/rc.d/init.d/functionselseecho -e "\atomcat: unable to locate functions lib. Cannot continue."exit -1fiRETVAL=$?CATALINA_HOME="/usr/java/tomcat" #tomcat安装目录case "$1" instart)if [ -f $CATALINA_HOME/bin/startup.sh ];thenecho $"Starting Tomcat"$CATALINA_HOME/bin/startup.shfi;;stop)if [ -f $CATALINA_HOME/bin/shutdown.sh ];thenecho $"Stopping Tomcat"$CATALINA_HOME/bin/shutdown.shfi;;*)echo $"Usage: $0 {start|stop}"exit 1;;esacexit $RETVAL
2、添加权限
chmod 755 /etc/rc.d/init.d/tomcat #使得脚本文件可执行
3、运行:
chkconfig --add /etc/rc.d/init.d/tomcat #将其加到服务中
4、执行指令
vi /usr/java/tomcat/bin/catalina.sh
文件中加入以下语句:
export JAVA_HOME=/usr/java/jdkexport CATALINA_HOME=/usr/java/tomcatexport CATALINA_BASE=/usr/java/tomcatexport CATALINA_TMPDIR=/usr/java/tomcat/temp
5、通过service启动服务
service tomcat start
service tomcat stop
6、reboot重启服务器测试,成功!!
阅读全文
0 0
- Linux设置Tomcat服务开机启动
- 设置 linux环境 tomcat 服务开机自启动
- linux添加tomcat服务并设置开机启动
- linux 设置开机启动服务
- Linux开机启动服务设置
- linux设置服务开机启动
- 设置linux开机启动服务
- Linux设置服务开机启动
- Linux设置开机启动服务
- tomcat设置开机自启动服务
- tomcat服务设置开机自动启动模式!
- suse11 linux 开机启动 tomcat服务
- linux 开机自启动 tomcat 服务
- Linux下开机启动tomcat,添加服务
- tomcat开机启动服务
- linux服务开机启动设置详解
- 设置Linux 服务的开机启动顺序
- Linux设置开机自启动服务
- ZooKeeper Getting Started Guide
- F
- 独立使用zuul网关分发不同服务的请求、权限控制,非SpringCloud
- AS启动之后一直refreshing gradle project
- python装饰器的wraps作用
- Linux设置Tomcat服务开机启动
- Hexo搭建个人博客
- Android 工具集合类库 API
- SQL语句的函数及查询
- CMD生成文件夹目录结构
- Python,写爬虫时遇到的问题笔记(一)
- centos使用nexus搭建私有maven仓库
- SSM框架——详细整合教程(Spring+SpringMVC+MyBatis)
- 【基本图像操作】Matplotlib