(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