--关闭和启动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项目
Linux下使用Xshell查看Tomcat实时日志中文乱码解决方案