Configure two or more Tomcat boots under Linux

Source: Internet
Author: User
Tags server port tomcat server

Configure two or more Tomcat boots under Linux(2012-08-14 11:59:31) reproduced
Tags: gossip Category: Linux_tomcat

The steps are as follows:

(1) Modify the/etc/profile file. Add a set of Java environment variables, and two sets of Catalina environment variables (I did not set this step, perhaps because my tomcat is a free-to-install version of it) remember to make it effective, with the command: Source/etc/profile

java_home=/usr/java/jdk1.7.0
Path= $JAVA _home/bin: $PATH
Classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export Java_home
Export PATH
Export CLASSPATH

#第一个Tomcat
catalina_base=/usr/local/apache-tomcat-6.0.35
catalina_home=/usr/local/apache-tomcat-6.0.35
Export Catalina_base Catalina_home
#第二个Tomcat
Catalina_2_base=/usr/local/apache-tomcat-6.0.35-second
Catalina_2_home=/usr/local/apache-tomcat-6.0.35-second
Export Catalina_2_base Catalina_2_home

#第一个Tomcat路径
tomcat_home=/usr/local/apache-tomcat-6.0.35
Export Tomcat_home
#第二个Tomcat路径
Tomcat_2_home=/usr/local/apache-tomcat-6.0.35-second
Export Tomcat_2_home

(2) Open the Server.xml under tomcat_2/conf, modify the shutdown port and the boot port. This allows you to run two tomcat at the same time under Linux. Running more Tomcat methods is the same.

(3) The main point is that when Tomcat starts, it looks for the root directory of the Tomat, and this is done by querying the system environment variables Catalina_home and

Catalina_base to do so, we just need to set these two variables.
Now we've copied Tomcat into 2 copies, TOMCAT1 and TOMCAT2,TOMCAT1. We use the default configuration that was previously configured

(Catalina_home and Catalina_base all point to the TOMCA1 directory), but tomcat2 we can no longer use the two configured on the system

Variable, then we will temporarily modify the settings Catalina_home and catalina_base under the Tomcat2 Bin directory catalina.sh

The root directory of TOMCAT2, if you add Tomcat and so on.

Open catalina.sh, find the following scarlet Letter, add the following code below

# OS Specificsupport. $var _must_ is set to either true Orfalse.

# Myself:add
Export catalina_base= $CATALINA _2_base
Export Catalina_home= $CATALINA _2_home

#设置虚拟机参数
Java_opts= "-xms512m-xmx512m-xss1024k-xx:permsize=128m-xx:maxpermsize=256m"

Another two:

boot two tomcat at the same time under Linux for Setup.Category: Linux 2014-08-28 16:07 239 people read reviews (0) favorite reports

Linux versions: Linux version 2.6.32-431.11.2.el6.x86_64

tomcat:apache-tomcat-6.0.41.tar.gz (official download)

Decompression TAR.GZ:TAR-ZXVF apache-tomcat-6.0.41.tar.gz to the corresponding path, can be extracted to two different paths or different folders under the same path, do not need to install, directly deploy the program.

Next, modify the Server.xml file in the Tomcat folder conf directory:

<server port= "8015" shutdown= "shutdown" > default = 8005--modified to 8015

<!--APR Library loader. Documentation At/docs/apr.html--
<listener classname= "Org.apache.catalina.core.AprLifecycleListener" sslengine= "on"/>
<!--Initialize Jasper prior to WebApps is loaded. Documentation At/docs/jasper-howto.html--
<listener classname= "Org.apache.catalina.core.JasperListener"/>
<!--Prevent memory leaks due to use of particular Java/javax apis-->
<listener classname= "Org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<!--JMX support for the TOMCAT server. Documentation At/docs/non-existent.html--
<listener classname= "Org.apache.catalina.mbeans.ServerLifecycleListener"/>
<listener classname= "Org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>

.........

<connector port= "8091" protocol= "http/1.1" by default is 8080--"modified to 8091 "

connectiontimeout= "20000"
redirectport= "8443"/>

........

<connector port= "8019" protocol= "ajp/1.3" redirectport= "8443"/> default = 8009--"modified to 8019 "

The above three red marked part of the modification, only need two files in this three different, start Tomcat, success.

Two identical Tomcat cannot start a workaround at the same timeCategory: Questions 2014-07-06 16:22 2116 People read Comments (1) favorite reports Tomcat server cluster

Problem: My server is Tomcat7.0.20, after modifying all ports (shutdown port, HTTP port, HTTPS port, AJP port), boot one cannot start another.

Two Startup.bat the front plus a set catalina_home= the current Tomcat path is available when the first Tomcat is booted, the port in the back of the server.xml of the Tomcat will still conflict with the newspapers regardless of how it is changed. Later running in DOS only to find that all Tomcat will find Catalina_home and catalina_base These two environment variables, so the steps are as follows:

1. Tomcat using a compressed version cannot be used with the installation version.

2. The configuration of the first Tomcat does not change.

3. Add the environment variable catalina_home2, which is the new Tomcat address, add the environment variable CATALINA_BASE2, and the value is the new Tomcat address.

4. Modify the Startup.bat in the new Tomcat to change the catalina_home to Catalina_home2.

5. Modify the Catalina.bat in the new Tomcat and change the catalina_home to Catalina_home2,catalina_base to Catalina_base2.

6.1 <server port= "8005" shutdown= "shutdown" > change the port to a port that is not used.

7 Success!

8 third, fourth ..... Wait for N Server reference 3~6 step order! Good luck! On the cmd command line execution 1, Netstat–ano view port Condition 2, tasklist view running program situation 3, kill the program that takes up the port that you need more

Configure two or more Tomcat boots under Linux

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.