美文网首页
Tomcat 单机部署多应用

Tomcat 单机部署多应用

作者: qyfl | 来源:发表于2019-12-03 18:50 被阅读0次

    1. 修改 /etc/profile 增加 tomcat 环境变量

    export CATALINA_HOME=/Users/xxx/tomcat1
    export CATALINA_BASE=/Users/xxx/tomcat1
    export TOMCAT_HOME=/Users/xxx/tomcat1
    
    export CATALINA_2_HOME=/Users/xxx/tomcat2
    export CATALINA_2_BASE=/Users/xxx/tomcat2
    export TOMCAT_2_HOME=/Users/xxx/tomcat2
    

    然后执行 source /etc/profile 使配置文件生效

    2. 修改 tomcat 配置

    1. 第一个 tomcat 配置不变

    2. 编辑第二个 tomcat 目录下 bin 下的 catalina.sh

    3. 找到 # OS specific support. $var _must_ be set to either true or false. 这一行,在这一行下面新增配置。

    export CATALINA_HOME=$CATALINA_2_HOME
    export CATALINA_BASE=$CATALINA_2_BASE
    
    1. 修改第二个 tomcat 下的 conf 下的 server.xml

    以下端口号的修改前提是:tomcat 之间不能重复,端口号没有被占用。

    1. 修改 Server port 端口,默认 8005
    <Server port="8005" shutdown="SHUTDOWN">    --->    <Server port="9005" shutdown="SHUTDOWN">
    
    2. 修改 Connector port 端口,默认 8080
    <Connector port="8080" protocol="HTTP/1.1"    --->    <Connector port="9080" protocol="HTTP/1.1"
    
    3. 修改第二个 Connector port 端口,默认 8009
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />    --->    <Connector port="9009" protocol="AJP/1.3" redirectPort="8443" />
    

    3. 启动两个 tomcat

    分别进去 tomcat 下的 bin 目录下运行 startup.sh

    相关文章

      网友评论

          本文标题:Tomcat 单机部署多应用

          本文链接:https://www.haomeiwen.com/subject/thhhgctx.html