How to manually deploy war packages through tomcat9 on windows and linux

How to manually deploy war packages through tomcat9 on windows and linux

The results are different in Windows and Linux environments.

Windows

Step 1: Use Maven to create a war package (if the 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 modify the port number in conf/server.xml)

Step 4: Just access the browser 127.0.0.1::8080

 

linux

Same operation, same deployment, no style, what the hell

Don't worry, don't worry. . .

There is a problem here. It defaults to adding the project name to the root directory. For example, hello-back is added above. In this way, some resource files cannot be loaded (because the resource files are relative to the root directory).

To change this root directory, just modify Tomcat's server.xml configuration file (it's in conf/server.xml)

Add the following sentence between <Host> and </Host>

<Context path="/" docBase="hello-back" debug="0" privileged="true"/> The path of this configuration refers to the root directory, and docBase refers to the war name

Summarize

The above is the method of manually deploying war packages on Windows and Linux through tomcat9 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • How to modify the memory size of Tomcat in Linux and Windows

<<:  How to modify the default storage engine in MySQL

>>:  Implementation example of react project from new creation to deployment

Recommend

Detailed explanation of how to enable slow query log in MySQL database

The database enables slow query logs Modify the c...

How to add docker port and get dockerfile

Get the Dockerfile from the Docker image docker h...

Detailed explanation of JavaScript prototype and examples

Table of contents The relationship between the co...

IE6 web page creation reference IE6 default style

This is not actually an official document of IE. I...

Quickjs encapsulates JavaScript sandbox details

Table of contents 1. Scenario 2. Simplify the und...

React internationalization react-i18next detailed explanation

Introduction react-i18next is a powerful internat...

How to install Android x86 in vmware virtual machine

Sometimes you just want to test an app but don’t ...

Implementation of Nginx load balancing cluster

(1) Experimental environment youxi1 192.168.5.101...

A brief analysis of the four import methods and priorities in CSS

First: 4 ways to introduce CSS There are four way...

About the processing of adaptive layout (using float and margin negative margin)

Adaptive layout is becoming more and more common i...

VMware vsphere 6.5 installation tutorial (picture and text)

vmware vsphere 6.5 is the classic version of vsph...

Example of using mycat to implement MySQL database read-write separation

What is MyCAT A completely open source large data...