A file system directory can be mapped into multiple virtual web directories, and the virtual Web directory name can be in the form of a multilevel directory structure, TOMCA the URL of the request in accordance with the longest path matching principle
To set the root directory for a Web site:
The root subdirectory of the application base directory set by the AppBase property of the <Host> element, using the <Context> element in the Server.xml file
<context path= "" docbase= "D:\text" debug= "0"/> Here D:\text refers to the text folder under the D-disk
To set up a virtual subdirectory of a Web site:
1. Use the <Contex> element in the Server.xml file
<context path= "/it315" docbase= "D:\myweb" debug= "0"/>
2. The XML file in a specific directory contains the <Contex> element
tomcat5.x <tomcat home directory >/conf/< engine name >/< hostname >
3. The AppBase property of the <Host> element sets the subdirectory of the application base directory that contains the Web-inf/web.xml file
4. The AppBase property of the <Host> element sets the war file in the application base directory
Note: The internal directory structure of the war file
The mapping principle of virtual Web directory