Tomcat7.0 sets the virtual directory

Source: Internet
Author: User

(1) Currently, our website is under the default directory tomcat/webapps. However, in some cases, we need to put the site in another directory, for example, the disk space of Tomcat is insufficient;

Or you want to put the project under a specific directory rather than the default directory for unified project management.

(2) We will solve this problem using today's method (also modifying the config/server. xml file ):

(3) find the server. xml file (config ----- server. xml notepad) as shown in the following figure)



(4) Open and pull to the bottom to find the location with the host



The red circle is what you need to add.

PATH is your project name. You can add '/' to the main file directory. docbase is the directory where your project is located. debug indicates whether debugging is 0 by default;


For example, in my address bar, enter localhost: 8080/lecheng in the address bar.


OK! Now, access is successful!

Tomcat7.0 sets the virtual directory

Related Article

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.