Configure multiple Tomcat instances in Linux to run at the same time

Source: Internet
Author: User
Tags nginx reverse proxy

In Linux, how does one configure multiple Tomcat to run simultaneously? First, change the variable to the First tomcat, and then modify the script started by the second tomcat.

How to start multiple Tomcat servers in the same system at the same time

Vi/etc/profile

Add
########## 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 and exit.
# Source/etc/profile
Go to the bin directory of the second tomcat
Add in catalina. sh
Export JAVA_HOME =
Export PATH =
Export CLASSPATH =
### The preceding three environment variables are JAVA environment variables that can be left empty ###
Export CATALINA_BASE = $ CATALINA_2_BASE
Export CATALINA_HOME = $ CATALINA_2_HOME
Finally, Open server. xml in tomcat_2/conf.

Modify the shudown port and start port. In this way, two tomcat servers can be run simultaneously in linux. Running more tomcat methods is the same.

The main point is that tomcat will search for the tomat root directory at startup, which is done by querying the system environment variables CATALINA_HOME and CATALINA_BASE, so we only need to set these two variables.
Now we copy tomcat into two copies, which are tomcat 1 and tomcat 2, respectively. For tomcat 1, we use the default configuration configured previously (CATALINA_HOME and CATALINA_BASE both point to the tomcache directory ), but tomcat2 we can no longer use the two variables configured on the system, so we are in catalina under the bin directory of tomcat2. sh temporary modification set CATALINA_HOME and CATALINA_BASE to the tomcat 2 root directory, if you add tomcat, and so on.

Load Balancing between Apache and multiple Tomcat clusters in Linux

Nginx Tomcat Cluster load balancing solution notes

Instance details Tomcat component installation + Nginx reverse proxy Tomcat + Apache use mod_jk and mod_proxy Reverse Proxy and load balancing

Build an Apache + Tomcat environment (JK deployment process)

In-depth analysis of Tomcat PDF

Tomcat details: click here
Tomcat: click here

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.