The mapping principle of virtual Web directory

Source: Internet
Author: User

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

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.