Tomcat below web App publishing path configuration (i.e. virtual directory configuration)

Source: Internet
Author: User

To publish a web app under Tomcat, there are several ways

1. Pack into a war and copy it to the tomcat/webapp/directory

This way, when Tomcat starts, it will be automatically extracted to the same name directory, access path with the directory name can be

2. Modify Conf/server.xml

Modify Conf/server.xml, find <Host> this configuration

Unpackwars= "true" autodeploy= "true"
Xmlvalidation= "false" Xmlnamespaceaware= "false" >
Add <context> config inside, i.e. add a Web application such as:

<context path= "/abc" docbase= "D:\del\workspace\testWeb\src\main\webapp" reloadable= "true" ></Context>

However, this configuration method is not recommended

3. Do not modify Server.xml "Recommended use of this method"

Create a new XML file under the Conf "Catalina" localhost for the Tomcat folder (for the Tomcat6 version and above, you need to make the two folders yourself Catalina and localhost). Content is <?xml version= "1.0" encoding= "UTF-8"?> <context     docbase= "Replace with your path"     reloadable= "true" > </ Context> Note that this way, configure path=?? is invalid, the path to the specific Web Access is based on the newly configured XML file name, such as Kkk.xml, so accessing this Web application requires/kkk/

Tomcat below web App publishing path configuration (i.e. virtual directory configuration)

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.