Methods for window and linux to manually deploy war packages through tomcat9
Personal testing in windows environment is different from linux environment.
Windows
Step 1: pack the war package with maven (if the resulting war package is named: hello-back.war)
Step 2: copy the war package to the webapps directory of the tomcat installation
Step 3: start tomcat (you can change the port number in conf/server.xml)
Step 4: just visit the browser. 127.0.0.1Dreg 8080.
Linux
Same operation, same deployment, no style, what the heck?
I'm not in a hurry.
There is a problem here, which defaults to adding the project name to the root directory, such as hello-back, so that some resource files cannot be loaded (because the resource files are relative to the root directory).
To modify this root directory, simply modify Tomcat's server.xml configuration file (it is in conf/server.xml)
Add the following sentence between and
The path in this configuration refers to the root directory, and docBase refers to the war name.
Summary
The above is the method that the editor introduces to you that window and linux manually deploy the war package through tomcat9. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!