Linux deploys multiple Tomcat

Source: Internet
Author: User
Tags server port

Linux deploys multiple Tomcat

1. Environment:
1.1. Centos 5.0
1.2.Tomcat 5.5.17

2. Need to solve a few problems
2.1. Different tomcat boot and shutdown listening on different ports
2.2. Different Tomcat's boot file startup.sh to specify the respective Catalina_home and catalina_base environment variables.

3. Steps to resolve:

3.1. Modify the profile file in the/etc directory, add a set of Java environment variables, and two sets of Catalina environment variables; The modified profile example is as follows:

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

catalina_base=/usr/tomcat7/apache-tomcat-7.0.65
catalina_home=/usr/tomcat7/apache-tomcat-7.0.65
Export Catalina_base Catalina_home

Catalina_2_base=/yaomajor/app-spring
Catalina_2_home=/yaomajor/app-spring
Export Catalina_2_base Catalina_2_home

tomcat_home=/usr/tomcat7/apache-tomcat-7.0.65
Export Tomcat_home

Tomcat_2_home=/yaomajor/app-spring
Export Tomcat_2_home


3.2. The first tomcat to be installed at the/usr/local/tomcat, keep the original after decompression without modification. Modify the second tomcat installed at//yaomajor/app-spring. There are two places to change:
3.2.1. Modify the Server.xml configuration and the first different boot, shutdown listening port. The following examples are modified:
<server port= "9005" shutdown= "Shutdown" > Ports: 8005->9005
<!--Define a non-ssl http/1.1 Connector on port8080-
<connector port= "9080" maxhttpheadersize= "8192" Port: 8080->9080
maxthreads= "minsparethreads=" maxsparethreads= "75"
Enablelookups= "false" redirectport= "8443" acceptcount= "100"
connectiontimeout= "20000" disableuploadtimeout= "true"/>
<!--Define an AJP 1.3 Connector on port 8009-->
<connectorport= "9009" Port: 8009->9009
Enablelookups= "false" redirectport= "8443" protocol= "ajp/1.3"/>
3.2.2. Modify the startup.sh and shutdown.sh under the bin. The modified example is as follows: (same modification)
Export java_home=/usr/java/jdk1.7.0_07
Export path= $PATH: $JAVA _home/bin
Export Classpath= $JAVA _home/lib
Export Catalina_home= $CATALINA _2_home using the second set in profile
exportcatalina_base= $CATALINA _2_base using the second set in profile

4. After the modification is complete, you must restart Linux. Could it be because the profile file was modified?

5. Enter the two Tomcat bin directory to launch the Tomcat--./startup.sh

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

7. If you want to start more than one can follow the analogy ...

My configuration:

-----------------------Greatwqs Install--------------------------------------------

1.server.xml

<!--Wang_qs update20110303-->
<server port= "9005" shutdown= "Shutdown" >

<!--WANG_QS Update 20110303-->
<connector port= "8288" protocol= "http/1.1"
connectiontimeout= "20000"
redirectport= "8443"/>

<!--Define an AJP 1.3 Connector on port 8009-->
<!--WANG_QS Update 20110303-->
<connector port= "9009" protocol= "ajp/1.3" redirectport= "8443"/>

2. Modify Startup.sh,shutdown.sh


#-----------------------------------------------------------------------------
# Wang_qs Install
#
#-----------------------------------------------------------------------------
Catalina_home=/yaomajor/app-spring
Catalina_base=/yaomajor/app-spring
Export Catalina_home
#利用profile中第二组设置
Export Catalina_base
#利用profile中第二组设置

==================================================================================================

Need to solve a few problems

Different tomcat boot and shutdown listening on different ports

Different Tomcat's boot file startup.sh to specify the respective Catalina_home and catalina_base environment variables.

Steps to resolve:

Modify the profile file in the/etc directory, add a set of Java environment variables, and two sets of Catalina environment variables; The modified profile example is as follows:

Java_home=/usr/java/jdk1.7.0_07

Classpath= $JAVA _home/lib/tools.jar: $JAVA _home/lib: $JAVA _home/bin

Export Java_home CLASSPATH

catalina_base=/usr/tomcat7/apache-tomcat-7.0.65

catalina_home=/usr/tomcat7/apache-tomcat-7.0.65

Export Catalina_base Catalina_home

Catalina_2_base=/yaomajor/app-spring

Catalina_2_home=/yaomajor/app-spring

Export Catalina_2_base Catalina_2_home

tomcat_home=/usr/tomcat7/apache-tomcat-7.0.65

Export Tomcat_home

Tomcat_2_home=/yaomajor/app-spring

Export Tomcat_2_home

The first tomcat to be installed at/opt/tomcat, keeping the unpacked intact without modification. Modify the second tomcat installed at/OPT/TOMCAT2. There are two places to change:

Modify the Server.xml configuration and the first different boot, shutdown listening ports. The following examples are modified:

<server port= "9005" shutdown= "Shutdown" > Ports: 8005->9005

<!--Define a non-ssl http/1.1 Connector on port8080-

<connector port= "9080" maxhttpheadersize= "8192" Port: 8080->9080

maxthreads= "minsparethreads=" maxsparethreads= "75"

Enablelookups= "false" redirectport= "8443" acceptcount= "100"

connectiontimeout= "20000" disableuploadtimeout= "true"/>

<!--Define an AJP 1.3 Connector on port 8009-->

<connectorport= "9009" Port: 8009->9009

Enablelookups= "false" redirectport= "8443" protocol= "ajp/1.3"/>

Modify the startup.sh and shutdown.sh under the bin. The modified example is as follows: (same modification)

Export java_home=/usr/java/jdk1.7.0_07

Export path= $PATH: $JAVA _home/bin

Export Classpath= $JAVA _home/lib

Export Catalina_home= $CATALINA _2_home using the second set in profile

exportcatalina_base= $CATALINA _2_base using the second set in profile

After the modifications are complete, you must restart Linux. Could it be because the profile file was modified?

Enter the two Tomcat bin directory to launch Tomcat ——./startup.sh

Then visit http://localhost:8080 and http://localhost:9080

Linux deploys multiple Tomcat

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.