CentOS 6.6下Tomcat集群(2)


--关闭和启动tomcat 服务,由此生成的tomcat没有重启命令:
# service tomcat1 stop
# service tomcat1 start
(2)将tomcat1设置开机自启动
将/usr/local/tomcat2/bin/catalina.sh文件复制到/etc/init.d目录下并改名为tomcat2
# cp /usr/local/tomcat2/bin/catalina.sh /etc/init.d/tomcat2
修改/etc/init.d/tomcat2文件,在文件中添加为红色部分:
# vi /etc/init.d/tomcat2
在第一行下面输入如下内容(否则出现错误:tomcat 服务不支持 chkconfig):
#!/bin/sh
# chkconfig: 2345 10 90
# description:Tomcat2 service

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
.....................................................................
# $Id: catalina.sh 1498485 2013-07-01 14:37:43Z markt $
# -----------------------------------------------------------------------------

CATALINA_HOME=/usr/local/tomcat2
JAVA_HOME=/usr/java/jdk1.7.0_79

# OS specific support. $var _must_ be set to either true or false.


--添加tomcat服务:
# chkconfig --add tomcat2
--设置tomcat为开机自启动:
# chkconfig tomcat2 on


--关闭和启动tomcat 服务,由此生成的tomcat没有重启命令:
# service tomcat2 stop
# service tomcat2 start

测试Tomcat
# cd /usr/local/tomcat/

RedHat Linux 5.5安装JDK+Tomcat并部署Java项目 

Tomcat权威指南(第二版)(中英高清PDF版+带书签) 

Tomcat 安全配置与性能优化

Linux下使用Xshell查看Tomcat实时日志中文乱码解决方案

CentOS 64-bit下安装JDK和Tomcat并设置Tomcat开机启动操作步骤

CentOS 6.5下安装Tomcat 

Tomcat 的详细介绍请点这里
Tomcat 的下载地址请点这里

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/ede9e3682fd4f7d976b796fae578204d.html