首页 > 代码库 > tomact配置多个地址 、多个项目

tomact配置多个地址 、多个项目

<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
  <Service name="Catalina">
    <Connector port="80" protocol="HTTP/1.1" 
               connectionTimeout="60000" 
               redirectPort="8443"
               maxThreads="100"     
               minSpareThreads="50"     
               maxSpareThreads="60"   
               acceptCount="60"  
               maxPostSize="0" 
               disableUploadTimeout="true" 
               compression="on"    
               compressionMinSize="50" noCompressionUserAgents="gozilla, traviata" 
               compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain"/>
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
    <Engine name="Catalina" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>
<!--xxx.xxx.xxx 表示访问地址-->
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">       
       <Context path="" docBase="/项目" debug="0" reloadable="true" />
      </Host>     
     <Host name="xxx.xxx.xxx"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">       
       <Context path="" docBase="/项目" debug="0" reloadable="true"/>
      </Host>
   <Host name="xxx.xxx.xxx"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">       
       <Context path="" docBase="/项目" debug="0" reloadable="true"/>
      </Host>
   </Engine>
  </Service>
</Server>

tomact配置多个地址 、多个项目