Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Install two or more tomcat under linux system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Edit environment variables: vi / etc/profile

Add the following code (tomcat path to configure your own actual tomcat installation directory)

# first tomcat#

CATALINA_BASE=/usr/local/tomcat

CATALINA_HOME=/usr/local/tomcat

TOMCAT_HOME=/usr/local/tomcat

Export CATALINA_BASE CATALINA_HOME TOMCAT_HOME

# first tomcat#

# second tomcat#

CATALINA_2_BASE=/usr/local/tomcat_2

CATALINA_2_HOME=/usr/local/tomcat_2

TOMCAT_2_HOME=/usr/local/tomcat_2

Export CATALINA_2_BASE CATALINA_2_HOME TOMCAT_2_HOME

# second tomcat#

Save exit.

Then enter: source / etc/profile to take effect.

The first tomcat, keep the decompressed as it is without modification.

two。 Go to the bin directory of the second tomcat

Open catalina.sh and find the scarlet letter below

# OS specific support. $var _ must_ be set to either true or false.

Add the following code below

Export CATALINA_BASE=$CATALINA_2_BASE (whatever the name of the variable defined above is defined here)

Export CATALINA_HOME=$CATALINA_2_HOME

3. Go to the conf directory of the second tomcat

Open the server.xml to change the port:

Modify the server.xml configuration and the first different startup and shutdown listening port.

The modified example is as follows:

Port: 8005-> 9005

9080

MaxThreads= "150" minSpareThreads= "25" maxSpareThreads= "75"

EnableLookups= "false" redirectPort= "8443" acceptCount= "100"

ConnectionTimeout= "20000" disableUploadTimeout= "true" / >

9009

EnableLookups= "false" redirectPort= "8443" protocol= "AJP/1.3" / >

Go to the bin directory of the two tomcat, and start tomcat--./startup.sh

Then visit both http://localhost:8080 and http://localhost:9080 to see the familiar tomcat welcome interface.

If you want to start more than one, you can follow this analogy.

Transferred from: https://www.cnblogs.com/shihaiming/p/5896283.html

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report