Deploy the second Tomcat (project)

This article is to solve for multiple Tomcat to run at the same time.

The following method is to describe my solution and share it with you. You can back up the files that need to be modified before referring to my method to avoid new errors that cannot be recovered after the occurrence. It can be helpful to netizens who have the same problems.

Because of the previous project, there is already a Tomcat on the computer, and a latest version of Tomcat has been installed recently, but when using it, clicking the startup.dat of the new version of tomcat always starts the old version, so Find the information to find out the reason, and at the same time allow the computer to use two tomcats. Since many of the answers I found on the Internet are incomplete, and I don’t think about them completely (mainly because the questions are not exactly the same as mine), so I plan to write my own experience and share it with everyone.

When there is already a tomcat on the computer, the reinstalled tomcat first needs to set the server.xml file, as follows: (I will use T2 to call the new tomcat, and T1 to call the existing tomcat in the computer)

1. Find the path to install T2, enter conf (mine: E:\tomcat\apache-tomcat-8.0.33\conf), find server.xml.

There are three things we need to modify: (The following shows the value after I modified)

1. <Server port="18005" shutdown="SHUTDOWN"> Change this port number to another one, not the same as the original one (I changed it to 18005);

2. <Connector port="9999" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> This is modified when the port number is modified, the original is 8080, and it is modified to one that I remember Value, used to access the homepage of T2, such as mine: http://localhost:9999/

3. <Connector port="18009" protocol="AJP/1.3" redirectPort="8443" /> This also needs to modify the port to be different from the original one.

After modifying these three values ​​of the server.xml file, it will be fine if it runs correctly. If you still jump to the previous T1 homepage, you need to configure environment variables.

According to my mistake, it may be inferred that the CATALINA_HOME environment variable was configured when T1 was installed before, so now when installing T2, it is also necessary to configure the second CATALINA_HOME2, and change the path in it to the path of T2.

Then modify catalina.bat under the bin folder in T2, and change CATALINA_HOME to CATALINA_HOME2.

Next, modify the value in startup.dat under the bin folder in T2: replace all CATALINA_HOME with CATALINA_HOME2.

Finally, run the startup.dat of T2 and visit the home page of T2.

Modify the title name of the Tomcat startup window

1. Find the catalina.bat  file  under  .../tomcat/bin

2. Open with notepad and find  if “%TITLE%” == “” set TITLE=Tomcat8-8080

3. TITLE = ...  is the title name of Tomcat, save it after modification
For example: if "%TITLE%" == "" set TITLE=Tomcat-custom name-1

How to see garbled characters in the window at this time: Solve the Chinese garbled characters in the Tomcat window_Xiao Daozi's Blog-CSDN Blog

Guess you like

Origin blog.csdn.net/wys0127/article/details/131121469