Tomcat publishes project details through Conf-catalina-localhost Catalog

Source: Internet
Author: User

Tomcat publishes projects in roughly three ways, but the side dishes think it is best to publish the project by adding a configuration file under Tomcat's Conf/catalina/localhost directory.

Because this is the least invasive of Tomcat, you only need to add a new configuration file, do not have to modify the original configuration, and support dynamic parsing, modify the code directly into effect (except for the modification of the configuration).

But the introduction of this method on the Internet is very simple, side dishes to add.

    1. add a server directly to eclipse and add the path to the Tomcat indicated in the process.

    2. Create an XML file under the Conf\catalina\localhost directory of the Tomcat server (the path cannot be found and create it yourself), as follows:

<context path= "/testpro" docbase= "D:\javaProject\TestPro\WebContent" debug= "0" privileged= "true" >

</Context>

Where path refers to the project's publishing path, that is, the access path, if you fill it like above, it is necessary to access: http://localhost:8080/TestPro/index.jsp;docBase refers to the project's WebContent (Eclipse) or Webroot (myeclipse) directory, well understood, your project is finally released, that is, the directory is published, through the configuration, direct tomcat to this directory, so you can run the project.

Note: XML     The file name must be consistent with the publishing path! In this example, the XML file name must be: Testpro

    3. start Tomcat in Eclipse and the project will start.

The top is a more common usage, but many times we want to publish the project to the Tomcat root so that you don't have to enter a lengthy publishing path and enter the domain name directly to access it.

To publish a project to the Tomcat root in this way, the following considerations are available:

    1. For the sake of insurance, delete the root folder under the WebApps directory in the Tomcat server.

    2. set path in XML to null (path= "").

    3. change the XML file name to ROOT (Root.xml).

This will allow the project to be published to the Tomcat root directory, which I hope is helpful for everyone.

Tomcat publishes project details through Conf-catalina-localhost Catalog

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.