tomcat deploy jfinal project

1: Create a directory: /var/www

2: Create a directory for the project that will be deployed, /var/www/my_project

3: Type the project into a war package, and then extract it to /var/www/my_project

4: The final directory structure is: /var/www/my_project/WEB-INF, that is, WEB-INF is under the project name directory

5: Modify the TOMCAT_HOME/conf/ server.xml file to find the Host tag, and add the following sub-tags to it: 

    <Context path="" docBase="/var/www/my_project" reloadable="false" />

6: Note that the appBase attribute in the Host tag should not be modified, let it be the default value "webapps"

7: Start tomcat and finish work

    The first key point: The project in the above configuration is deployed outside the TOMCAT_HOME/webapps directory. This is to avoid the pit of tomcat loading the project twice, because if the project is configured in the configuration file, it will be loaded once, and The project will be automatically loaded again under webapps. This pit will cause some inexplicable problems. For example, in the old version of tomcat, the session is confused after multiple logins at the same time. Another example: some projects have scheduled tasks, if repeated Load the project, then the scheduled task will be executed multiple times. So remember the first point, never put your project under the TOMCAT_HOME/webapps directory.

   The second key point: the path attribute of the Context tag in the above configuration must be set to "" instead of "/", otherwise it will jump into a pit. The absolute address of the project name is placed after the docBase attribute, and it is a value similar to this under windows: d:/www/my_project.

   Simply put, the configuration under tomcat is divided into two steps, one is to build a directory outside the webapps directory and put the project, and the other is to find the Host tag and put it in the Context sub-tag.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325680941&siteId=291194637