Tomcat配置多个端口号或多个应用,使得域名后面加不同端口访问

1.一个Tomcat下配置多个端口号,这里是针对一个应用服务而言,只需在Service下配置多个。如下:


            port="8089" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               debug="0" connectionTimeout="20000" URIEncoding="utf-8"
               disableUploadTimeout="true" />
                   enableLookups="false" redirectPort="8443" debug="0"
               protocol="AJP/1.3" />
     
               enableLookups="false" redirectPort="8443" acceptCount="100"
               debug="0" connectionTimeout="20000" URIEncoding="utf-8"
               disableUploadTimeout="true" />
   
                     unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
             

   


在这个应用里,可以用8089端口号访问服务,也可以用8099端口号来访问服务;

(注:这里的Host中没有配置context内容,是通过D:\Java\Tomcat 5.0\conf\Catalina\localhost下的一个*.xml指定的)这里的*.xml的内容如下:


2.在一个Tomcat下配置多个服务,用不同的端口号。


            debug="0"/>
            debug="0"/>

   

                  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
     

   


         port="8089" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               debug="0" connectionTimeout="20000" URIEncoding="utf-8"
               disableUploadTimeout="true" />
                   enableLookups="false" redirectPort="8443" debug="0"
               protocol="AJP/1.3" />
     
               enableLookups="false" redirectPort="8443" acceptCount="100"
               debug="0" connectionTimeout="20000" URIEncoding="utf-8"
               disableUploadTimeout="true" />
   
                    prefix="catalina_log." suffix=".txt"
              timestamp="true"/>
                       debug="0" resourceName="UserDatabase"/>
             unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
                         directory="logs" prefix="localhost_log." suffix=".txt"
            timestamp="true"/>
     

   


               enableLookups="false" redirectPort="8443" acceptCount="100"
               debug="0" connectionTimeout="20000" URIEncoding="utf-8"
               disableUploadTimeout="true" />

     resourceName="UserDatabase"/>

     unpackWARs="true" autoDeploy="true"
     xmlValidation="false" xmlNamespaceAware="false">
  
  



你可能感兴趣的:(jsp)