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 implementation plan of Vue front-end exporting Excel files

Table of contents 1. Technology Selection 2. Tech...

Blog Design Web Design Debut

The first web page I designed is as follows: I ha...

CSS XTHML writing standards and common problems summary (page optimization)

Project Documentation Directory Div+CSS Naming Sta...

Tutorial on using iostat command in Linux

Preface It is said that if the people doing opera...

Docker memory monitoring and stress testing methods

The Docker container that has been running shows ...

How to implement the builder pattern in Javascript

Overview The builder pattern is a relatively simp...

How does Vue3's dynamic components work?

Table of contents 1. Component Registration 1.1 G...

Summary of several key points about mysql init_connect

The role of init_connect init_connect is usually ...

N ways to achieve two-column layout with CSS

1. What is a two-column layout? There are two typ...

Detailed explanation of redo log and undo log in MySQL

The most important logs in the MySQL log system a...

Analysis of the methods of visual structure layout design for children's websites

1. Warm and gentle Related address: http://www.web...

React hooks pros and cons

Table of contents Preface advantage: shortcoming:...

CSS implements six adaptive two-column layout methods

HTML structure <body> <div class="w...