Learn how to deploy and start multiple tomcats and migrate projects in one article

Learn how to deploy and start multiple tomcats and migrate projects in one article

Sometimes when we are writing a web project, there are several projects that need to run at the same time, but there will always be various problems when placing the war package directly, such as deploying multiple projects on the same Tomcat and the same port, or deploying multiple projects on multiple ports of the same Tomcat. After several tests, I decided to share it with you. I won’t talk much about the installation of JDK. Just configure the environment variables. Here is a detailed operation process for you:

Deploy tomcat

1. Download and decompress

Download tomcat from the official website and decompress it

2. Modify the configuration file

Open the conf directory

Modify the server.xml file to change the http access port (the default is port 8080)

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8"/>

  <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443"/>

Can be modified as (for reference only, according to personal needs):

<Connector port="8088" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8"/>

  <Connector executor="tomcatThreadPool"
               port="8088" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443"/>

Change 8080 to the port number that is no longer in use by the first tomcat. The port number set here is the port number used to access the web in the future.

Change the shutdown port (the default is port 8005)

<Server port="8005" shutdown="SHUTDOWN" debug="0">

Can be modified as (for reference only, according to personal needs):

<Server port="8095" shutdown="SHUTDOWN" debug="0">

Change 8005 to a port number that is not in use

(3) Change the JVM startup port (the default is port 8009)

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

Can be modified as (for reference only, according to personal needs):

<Connector port="8099" protocol="AJP/1.3" redirectPort="8443" secretRequired="" />

Remember to uncomment this line. It is very important to add the configuration of secretRequired="" here, otherwise you will report the error org.apache.catalina.LifecycleException: The protocol processor failed to start! ! !

Change 8009 to a port number that is not in use

Modify logging.properties

To solve the problem of garbled Chinese output in the tomcat console

Change utf-8 in logging.properties to GBK

Running Tests

insert image description here

Transplantation Project

1. Packaging the original project

If it is a Maven project, first click the following command to execute install

insert image description here

Then, go to the directory of your Maven repository and find the package (if you don’t know your repository directory, you can go there)

As shown

insert image description here

Next, copy this package

insert image description here

2. Copy to tomcat

Then paste it under tomcat's webapps, as shown below

insert image description here

In this way, after Tomcat runs, it will automatically decompress it for you

3. Visit and try

insert image description here

Finish! ! !

The above is the detailed content of how to deploy and start multiple tomcats and transplant projects. For more information about tomcat deployment and startup, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • How to implement hot deployment and hot start in Eclipse/tomcat
  • Solution to the problem that eclipse deploys tomcat server and cannot start
  • Solution to the problem that SpringBoot application cannot be started when deployed to Tomcat

<<:  An article to teach you HTML

>>:  MySql development of automatic synchronization table structure

Recommend

JavaScript flow control (loop)

Table of contents 1. for loop 2. Double for loop ...

Summary of Git commit log modification methods

Case 1: Last submission and no push Execute the f...

ReactHooks batch update state and get route parameters example analysis

Table of contents 1. How to update in batches Con...

Install Mininet from source code on Ubuntu 16.04

Mininet Mininet is a lightweight software defined...

Detailed explanation of asynchronous programming knowledge points in nodejs

Introduction Because JavaScript is single-threade...

MySQL uses limit to implement paging example method

1. Basic implementation of limit In general, the ...

WeChat applet canvas implements signature function

In the WeChat applet project, the development mod...

Vue.set() and this.$set() usage and difference

When we use Vue for development, we may encounter...

Boundary and range description of between in mysql

mysql between boundary range The range of between...

mysql solves time zone related problems

Preface: When using MySQL, you may encounter time...

A detailed guide to custom directives in Vue

Table of contents 1. What is a custom instruction...

MySQL permission control detailed explanation

Table of contents mysql permission control Permis...

MySQL MyISAM default storage engine implementation principle

By default, the MyISAM table will generate three ...