Tomcat7.0 sets virtual directory (1) Currently, our website sites are placed in the default directory: tomcat/webapps/. However, in some cases, we need to put the site in other directories, for example: there is insufficient space on the disk where tomcat is located; Or for unified management of the project, you want to put it in a specific directory instead of the default directory. (2) Then we will use today's method to solve this problem (also modify the config/server.xml file): (3) Find the server.xml file according to the picture below (open config-----server.xml in Notepad) (4) After opening, scroll to the bottom and find the HOST The red circled part is what you need to add <Context> represents a single web application running on <Host> A <Host> can have multiple <Context> elements. Each web application must have a unique URL path, which is set in the path attribute of <Context>. Attributes of the path: specifies the URL entry for accessing the Web application. The path must start with "/", otherwise an error will be reported. docBase: specifies the file path of the Web application. You can give an absolute path or a relative path relative to the appBase attribute of <Host>. If the Web application uses an open directory structure, specify the root directory of the Web application. If the Web application is a war file, specify the path of the war file. reloadable: If this property is set to true, the Tomcat server will monitor changes to class files in the WEB-INF/classes and WEB-INF/lib directories while running. If it detects that a class file has been updated, the server will automatically reload the Web application. Setting the reloadable attribute to true during the development phase helps debug servlets and other class files, but this will increase the server load. It is recommended to set reloadable to false during the development and storage phase of a Web application. For example, in my address bar, enter OK! Click here for a successful visit! Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: How to solve mysql error 10061
>>: React tsx generates random verification code
System environment: centos7.4 1. Check whether th...
Meta tag function The META tag is a key tag in th...
Preface The electricity in my residence has been ...
html ¶ <html></html> html:xml ¶ <h...
Execution problem between mysql max and where Exe...
Table of contents 1. Vue life cycle 2. Hook funct...
You can use yum to install all dependencies toget...
This article shares the specific code of vue+echa...
Table of contents Implementing a search engine ba...
Page layout has always been my concern since I st...
Some usage of float Left suspension: float:left; ...
1. CSS style solves the problem of displaying ell...
1. Use CSS Copy code The code is as follows: style...
In the process of learning web design, I did not ...
Problem Description 1. Database of the collection...