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)