Tomcat multi-port-based virtual host configuration

Source: Internet
Author: User

I have two more projects to deploy on one machine, two projects for two different services, one to start listening on 8001 and another to listen on 8002 ports, which is a multi-port-based virtual machine host configuration, only need to change the conf/in the Tomcat directory Server.xml configuration file with the following contents:

<?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><!--  Application 1  Personal Center WAP version-->  < Service name= "Catalina1" >    <connector port= "8001"  protocol= "HTTP/ 1.1 " connectiontimeout=" 20000 " redirectport=" 8443 " />    <connector  port= "8009"  protocol= "ajp/1.3"  redirectport= "8443"  />    < Engine name= "Catalina1"  defaulthost= "localhost" >      <realm  classname= "Org.apache.catalina.realm.UserDatabaseRealm"               rEsourcename= "userdatabase"/>       

Then start Tomcat on the line. (The tomcat version of this test is 1.6.x JDK version 1.6.x)

Tomcat multi-port-based virtual host configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.