Put the project into the Tomcat root directory

Source: Internet
Author: User

The purpose of deploying an app to the Tomcat root is to access the app directly through "Http://[ip]:[port." Instead of using the "http://[ip]:[port]/[appname" context path.

Method One: (the simplest and most straightforward method)

Delete All files under the original Webapps/root directory and copy all files and folders under the application to the ROOT folder.

Method Two:

Delete All files under the original Webapps/root directory, modify the file "Conf/server.xml", and add the following context content configuration under the host node:

 

Attention:

1) The value of path is set to null;

2) The application should not be placed in the WebApps directory of Tomcat (if the above configuration is placed in the Custom folder MyApps), otherwise the access path is very problematic;

3) docbase specified to absolute path.

After this setting restarts Tomcat, if docBase points to a war file, the war is automatically extracted to the Webapps/root directory, if docBase points to the application of the extracted directory, such as docbase= "c:/ APACHE-TOMCAT-6.0.32/MYAPPS/BC ", Tomcat does not generate the Webapps/root directory (in which case the Webapps/root directory may not be deleted before, but webapps/ The content within the root directory is inaccessible), and the directory specified by Docbase is used directly when accessed.

Method Three:

Similar to method two, but not to modify the global profile "Conf/server.xml", but in the "Conf/catalina/localhost" directory to add a new file "root.xml" (Note the case, OH), the file content is as follows:

<?xml version= "1.0" encoding= "UTF-8"? ><context path= "" Docbase= "C:/apache-tomcat-6.0.32/myapps/bc.war" ></Context>


Put the project into the Tomcat root 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.