tomcat7.0 server.xml Modification (default directory, port, multiple domain names)

Source: Internet
Author: User

The Conf folder under the Tomcat directory, server.xml

1. Modify the default WebApps

1 <  name= "localhost"  appBase= "WebApps"  unpackwars= " True "  autodeploy=" true ">2   ... 3 </ Host >

AppBase can be modified to your site location such as: D:/web

2. Modify the default directory root

Specifically, with the content tag between <Host></Host>, you can understand that each content represents an app.

1 <  path= ""  docBase= "/myweb"  debug= "0"  reloadable  = "true"/>

Path is the name of the virtual directory, if you want to enter only the IP address to display the home page, the key value is left blank;
Docbase is the path to the virtual directory, it defaults to the $tomcat/webapps/root directory, and now I have a myweb directory under the WebApps directory, which is the default directory for my directory.
Debug and reloadable are generally set to 0 and true respectively.

3. Default port

1 <  port= "8080"  protocol= "http/1.1"  connectiontimeout= " 20000 "  redirectport=" 8443 "/>

Switch port to your port

4. Bind Domain Name

1 <Hostname= "Xx.com"AppBase= "WebApps"Unpackwars= "true"Autodeploy= "true">2     <Alias>Www.xx.com</Alias> <!--Multiple domain names -3 </Host>

5. Multiple projects

1 <Hostname= "AA.com"AppBase= "WebApps"Unpackwars= "true"Autodeploy= "true">2 ...3 </Host>4 5 <Hostname= "Bb.com"AppBase= "WebApps"Unpackwars= "true"Autodeploy= "true">6 ...7 </Host>

6, the Chinese picture name does not show the solution

1 <  port= "8080"  connectiontimeout= "20000"  disableuploadtimeout  = "true"  uriencoding= "Utf-8"/>

Appendix: Reference from: http://www.cnblogs.com/ilovecss/archive/2013/04/28/3049098.html

tomcat7.0 server.xml Modification (default directory, port, multiple domain names)

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.