Tomcat Virtual Host configuration scheme (domain name resolution) for Windows/linux (full version) __linux

Source: Internet
Author: User

On the internet for a long time also did not find the relevant information, are said too vague.
I configure tomcat under a multiple domain name method detailed below, according to the following configuration must be successful, after testing.

Unpackwars= "true" autodeploy= "true"
Xmlvalidation= "false" Xmlnamespaceaware= "false" >
<Alias>localhost.com</Alias>
<logger classname= "Org.apache.catalina.logger.FileLogger"
directory= "Logs" prefix= "Localhost_log." suffix= ". txt"
Timestamp= "true"/>
<context path= "" docbase= "D://tomcat 5.0//webapps//gg" reloadable= "true" Casesensitive= "false" debug= "0" ></ Context>
</Host>

        unpackwars= "true" autodeploy= "true"
       xmlvalidation= "false" Xmlnamespaceaware= "false"
       <alias>one.localhost.com</alias >&NBSP
       <logger classname= "Org.apache.catalina.logger.FileLogger"
                 directory= "Logs"   prefix= "Localhost_log." suffix= ". txt"
             timestamp= "true"/>
       <context path= "docbase=" D://tomcat 5.0//webapps//kk//a "  reloadable=" true "Casesensitive=" false "debug=" 0 "></CONTEXT>
</Host>

Unpackwars= "true" autodeploy= "true"
Xmlvalidation= "false" Xmlnamespaceaware= "false" >
<Alias>two.localhost.com</Alias>
<logger classname= "Org.apache.catalina.logger.FileLogger"
directory= "Logs" prefix= "Localhost_log." suffix= ". txt"
Timestamp= "true"/>
<context path= "" docbase= "D://tomcat 5.0//webapps//kk//b" reloadable= "true" Casesensitive= "false" debug= "0" > </Context>
</Host>

Because no domain name resolution server, so in the hosts match, to simulate DNS resolution.

10.1.1.241 localhost point to GG folder
10.1.1.241 localhost.com point to GG folder
10.1.1.241 One.localhost point to Folder a
10.1.1.241 one.localhost.com point to Folder a
10.1.1.241 Two.localhost point to Folder B
10.1.1.241 two.localhost.com point to Folder B

After many attempts, finally in Tomcat configuration succeeded.

When modifying the default application: Change the Defaulthost and set the context path to empty.

When configuring multiple applications:

such as: http://localhost:8080/

Http://localhost:8080/first

Http://localhost:8080/second

The corresponding configuration is as follows:

       Unpackwars= "true" autodeploy= "true"
       xmlvalidation= "false" Xmlnamespaceaware= "false"
       <Alias>localhost.com</Alias> &NBSP
       <logger classname= "Org.apache.catalina.logger.FileLogger"
                 directory= " Logs "  prefix=" Localhost_log. "suffix=". txt "
             timestamp= "true"/>
        <context path= "" DocBase = "D://tomcat 5.0//webapps//root"   reloadable= "true" Casesensitive= "false" debug= "0" ></Context>

        <context path= "/first" docbase= "D://tomcat 5.0//webapps//first"   reloadable= "true" Casesensitive= "false" debug= "0" ></CONTEXT>
         <context path= "/second" docbase= "D://tomcat 5.0//webapps//second"   reloadable= "true" casesensitive= " False "debug=" 0 ></context>

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.