Tomcat domain name configuration under linux


1. It looks like multi-domain configuration

1: Change the default port 8080 to 80, because 80 is the default web port.
<Connector port="8080" protocol="HTTP/1.1"
 
connectionTimeout="20000"
  redirectPort="8443" URIEncoding="UTF-8"/>
2: Copy the following content to /conf/server.xml.

<Host name="configured domain name" appBase="/home/temobi"
   unpackWARs="true" autoDeploy="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:
       

 <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"  
              
      prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
        -->


      
</Host >

3: Create a new ROOT folder under /home/temobi,

4: Copy the contents of the temobi project under the local tomcat to the /home/temobi/ROOT folder.

5: Copy the host-manager folder and manager folder under tomcat/webapps to the /home/temobi folder.

Alright, you're done!


2. Single domain name configuration


1: Change the default port 8080 to 80, because 80 is the default web port.
<Connector port="8080" protocol="HTTP/1.1"
 
connectionTimeout="20000"
  redirectPort="8443" URIEncoding="UTF-8"/>
2: Copy the following content to /conf/server.xml.

<Host name="Configured domain name"


     
   <!-- 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>

3: Delete the content under tomcat/webapps/ROOT, and delete the folder in the local project Put it under tomcat/webapps/ROOT.

Alright, you're done!

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326802629&siteId=291194637