tomcat部署多个站点

只要在tomcat的server.xml中增加一个service节点,新建一个webapps2文件夹,把新站点的文件放到这个文件中的ROOT目录下即可

<Service name="Catalina">
     <Connector port="8088" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <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="webapps2"
            unpackWARs="true" autoDeploy="true">
        <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>

 

posted @ 2023-10-09 17:40  榕树下的回忆  阅读(73)  评论(0编辑  收藏  举报