Tomcat multi-domain configuration and tomcat Domain Configuration

Source: Internet
Author: User

Tomcat multi-domain configuration and tomcat Domain Configuration

1. Find your tomcat and Open server. xml in the conf file;

<Serverport ="8005"Shutdown ="SHUTDOWN">

 <ListenerclassName =" Org. apache. catalina. core. AprLifecycleListener"SSLEngine =" On"/>  <ListenerclassName =" Org. apache. catalina. core. JasperListener"/>  <ListenerclassName =" Org. apache. catalina. mbeans. ServerLifecycleListener"/>  <ListenerclassName =" Org. apache. catalina. mbeans. GlobalResourcesLifecycleListener"/>   <GlobalNamingResources>  <Resourcename =" UserDatabase"Auth =" Container"Type =" Org. apache. catalina. UserDatabase"Description =" User database that can be updated andsaved"Factory =" Org. apache. catalina. users. MemoryUserDatabaseFactorY"Pathname =" Conf/tomcat-users.xml"/> </GlobalNamingResources> <Servicename =" Catalina">  <Connectorport =" 8080"Protocol =" HTTP/1.1"MaxThreads =" 150"ConnectionTimeout =" 20000"RedirectPort =" 8443"/> <! -- <Connector port = "8443" protocol = "HTTP/1.1" SSLEnabled = "true"
                            MaxThreads = "150" scheme = "https" secure = "true"
                            ClientAuth = "false" sslProtocol = "TLS"/>
  -->  <Connectorport =" 8009"Protocol =" AJP/1.3"RedirectPort =" 8443"/>  <Enginename =" Catalina"DefaultHost =" Localhost"> <! -- <ClusterclassName = "org. apache. catalina. ha. tcp. SimpleTcpCluster"/>
 --> <! -- <ValveclassName = "org. apache. catalina. valves. RequestDumperValve"/>
 -->  <RealmclassName =" Org. apache. catalina. realm. UserDatabaseRealm"ResourceName =" UserDatabase"/> <Hostname =" Localhost"AppBase =" Webapps"UnpackWARs =" True"AutoDeploy =" True"XmlValidation =" False"XmlNamespaceAware =" False"> <! -- <ValveclassName = "org. apache. catalina. authenticator. SingleSignOn"/>
 --> <! -- <ValveclassName = "org. apache. catalina. valves. AccessLogValve" directory = "logs"  
    Prefix = "localhost_access_log." suffix = ". txt" pattern = "common" resolveHosts = "false"/>
  --> </Host> </Engine> </Service> </Server> here, I mainly modify the two places: the first one will <Connectorport =" 8080"Protocol =" HTTP/1.1"MaxThreads =" 150"ConnectionTimeout =" 20000"RedirectPort =" 8443"/> Changed to: <Connectorport =" 80"Protocol =" HTTP/1.1"MaxThreads =" 150"ConnectionTimeout =" 20000"RedirectPort =" 8443"/> Second, add <Hostname =" Localhost"AppBase =" Webapps"UnpackWARs =" True"AutoDeploy =" True"XmlValidation =" False"XmlNamespaceAware =" False"   />
</Engine> change to <Engine name =" Catalina"DefaultHost = Www.abc.com>
<Hostname = "www.coe.com" appBase =" Webapps"UnpackWARs =" True"AutoDeploy =" True"XmlValidation =" False"XmlNamespaceAware =" False" > <Contextpath = "" docbase =" D: \ Tomcat6.0 \ webapps \ ROOT"Crosscontext =" True"/> </Host>
<Hostname =" Www. abc. Com"AppBase =" Ccc"UnpackWARs =" True"AutoDeploy =" True" XmlValidation =" False"XmlNamespaceAware =" False">
<Contextpath = "" docbase =" D: \ Tomcat 6.0 \ ccc \ ROOT"Crosscontext =" True"/> </Host>
<Host name = Www. CBA .comAppBase =" Dddd"UnpackWARs =" True"AutoDeploy =" True"XmlValidation =" False"XmlNamespaceAware =" False"/> <Contextpath =" "docbase =" D: \ Tomcat6.0 \ dddd \ ROOT"Crosscontext =" True"/> </Host>
</Engine> tomcat directory configuration is as follows:

Both ccc and dddd are independent projects, and each project must be placed in the root folder for multi-domain access.
 

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.