linux环境下配置和使用多个tomcat
(1)修改/etc/profile文件。添加一组java环境变量,和两组CATALINA环境变量(我没有进行此步骤的设置,可能因为我的Tomcat是免安装版的吧)
记得修改完要使其生效,用命令:source /etc/profile
JAVA_HOME=/usr/java/jdk1.7.0
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH
#第一个Tomcat
export CATALINA_BASE=/usr/local/apache-tomcat-6.0.35
export CATALINA_HOME=/usr/local/apache-tomcat-6.0.35
#第二个Tomcat
export CATALINA_2_BASE=/usr/local/apache-tomcat-6.0.35-second
export CATALINA_2_HOME=/usr/local/apache-tomcat-6.0.35-second
(2).修改server.xml配置和第一个不同的启动、关闭监听端口。修改后示例如下:
<Server port="8050" shutdown="SHUTDOWN"> 端口:8049->8050
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector port="9080" maxHttpHeaderSize="8192" 端口:8080->9080
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector port="9080" maxHttpHeaderSize="8192" 端口:8080->9080
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
(3)打开catalina.sh ,tomcat/bin/找到下面红字,在下面增加如下代码
# OS specific support. $var _must_ be set to either true or false.
# myself : add
export CATALINA_BASE=$CATALINA_2_BASE
# OS specific support. $var _must_ be set to either true or false.
# myself : add
export CATALINA_BASE=$CATALINA_2_BASE
export CATALINA_HOME=$CATALINA_2_HOME
相关推荐
graseed 2020-10-28
jinhao 2020-09-07
yoohsummer 2020-06-01
SXIAOYI 2020-09-16
impress 2020-02-20
chenshuixian 2013-06-01
羽化大刀Chrome 2013-05-31
kanpiaoxue 2013-06-19
quanhaoH 2013-06-17
pigsmall 2020-11-19
大数据杂谈 2020-09-26
ChinaWin 2020-08-13
mohanzb 2020-08-01
王国平 2020-06-20
kangtingting0 2020-05-20
MichelinMessi 2020-02-19
nicepainkiller 2020-01-25
hfszy0 2013-05-15
lizhenmxcz 2013-05-12