Linux上配置多个tomcat的配置修改(修改tomcat配置)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Try_harder_every_day/article/details/83545948

1、修改环境变量

     #vi  /etc/profile

####### 工程1 tomcat1#######
export CATALINA_BASE=/data/server/tomcat
export CATALINA_HOME=$CATALINA_BASE
export TOMCAT_HOME=$CATALINA_BASE

#######  工程2  tomcat2#######
export CATALINA_2_BASE=/data/tomcat-2
export CATALINA_2_HOME=$CATALINA_2_BASE
export TOMCAT_2_HOME=$CATALINA_2_BASE


#######  工程3  tomcat3#######
export CATALINA_3_BASE=/data/tomcat-3
export CATALINA_3_HOME=$CATALINA_3_BASE
export TOMCAT_3_HOME=$CATALINA_3_BASE


保存退出。
  #source /etc/profile

2、修改 对应tomcat中的 catalina.sh,添加环境变量

按照 第二个tomcat为例 (其它的一样这样配置)

  #vi /data/tomcat-upgrade/bin/catalina.sh

在 # OS specific support.  $var _must_ be set to either true or false.后添加
export CATALINA_BASE=$CATALINA_2_BASE
export CATALINA_HOME=$CATALINA_2_HOME

3、 修改 tomcat的配置文件 server.xml

  #vi /data/tomcat-upgrade/conf/server.xml

修改下面标记的端口即可,防止端口占用

<Connector port="7080" protocol="HTTP/1.1"
               connectionTimeout="30000"
               maxHttpHeaderSize="20480"
               minSpareThreads="20"
               maxSpareThreads="50"
               maxThreads="500"
               acceptCount="500"
               maxProcessors="1000"
               minProcessors="5"
               useURIValidationHack="false"
               enableLookups="false"
               redirectPort="8443"/>
    


    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="7088" protocol="AJP/1.3" redirectPort="8443" />

猜你喜欢

转载自blog.csdn.net/Try_harder_every_day/article/details/83545948