tomcat配置两个端口两个项目

痞子三分冷 提交于 2019-12-01 19:29:55

修改tomcat安装目录下的conf-->setting.xml文件

 <!-- 第二个项目 -->
  <Service name="Catalina">
  <!-- 配置第二个项目的端口为8089,其他项目端口不能有冲突 -->
    <Connector port="8089" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8445" />
    <Engine name="Catalina" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>
      <Host name="localhost"  appBase="webapps1" unpackWARs="true" autoDeploy="true">      <!-- 在webapps同级新建一个文件夹webapps1 -->     
        <Context path="" docBase="D:\Install\Tomcat 9.0\webapps1\Czgtj" reloadable="true" />   <!-- 将第二个项目放入webapps1 --> 
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>
    </Engine>
  </Service>

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!