About some notes server.xml tomcat's configuration host node

In fact, this has been confused, and later the company's Web site encounter with IIS integration, and above there are several applications need to be configured, so the server.xml tomcat were some insight into the

Host nodes mainly up a domain name that resolves to the virtual host, domain name whose name property is the access, the default is 127.0.0.1, localhost and local Ip, when a DNS specified, can rely on the specified virtual domain host access. Inside some of the attributes do not speak, you see the word can basically understand what it meant.

Then is the context node that is the main access to the virtual host configuration in the project, the project is the default access in the context attribute path = "" project, a virtual host can not be set simultaneously in two projects path = "", if in this case, tomcat will not start. The main path is the project name, if specified web access, while docBase which specifies the name of the physical path.

 <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
   <Context path="" docBase="web1" reloadable="true" crossContext="true" /> 
        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"  
               prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
        -->

  </Host>
  
  <Host name="paper" appBase="webapps" 
   unpackWARs="true" autoDeploy="true" 
   xmlValidation="false" xmlNamespaceAware="false">
   <Context path="web2" docBase="web2" reloadable="true" crossContext="true" /> 
  </Host>

Today configuration parameters wrote

?
1
2
3
4
< Host name = "test.jb51.net" appBase = "E:\webroot\jsp" uppackWARs = "true" xmlValidation = "false" xmlNamespaceAware = "false" >
     < Context path = "" docBase = "E:\webroot" debug = "0" reloadable = "true" />
  </ Host >
</ Host >

name: corresponds to the domain name of your project;
the appBase: path to the virtual directory (the directory used to run the jsp);
doBase: top-level directory of the project is equivalent to the webapps directory name, that is, iis in the site root;
Configuration after completing remember to copy your project to the D: \ directory under webroot, my project is ecshoping

Be sure to add a note or after </ Host> <host before.

Of course, also you need to modify the configuration of isapi_redirect

Specifically refer to the article: //www.jb51.net/article/51924.htm

Guess you like

Origin www.cnblogs.com/zhuyeshen/p/11425604.html