1. Turn off the firewall and transfer the software package required to install Tomcat to the /opt directory jdk-8u201-linux-x64.rpm apache-tomcat-9.0.16.tar.gz systemctl stop firewalld systemctl disable firewalld setenforce 0 2. Install JDK cd /opt rpm -qpl jdk-8u201-linux-x64.rpm rpm -ivh jdk-8u201-linux-x64.rpm java -version 3. Install Tomcat cd /opt tar zxvf apache-tomcat-9.0.16.tar.gz mkdir /usr/local/tomcat mv apache-tomcat-9.0.16 /usr/local/tomcat/tomcat1 cp -a /usr/local/tomcat/tomcat1 /usr/local/tomcat/tomcat2 4. Configure Tomcat environment variables vim /etc/profile.d/tomcat.sh #tomcat1 export CATALINA_HOME1=/usr/local/tomcat/tomcat1 export CATALINA_BASE1=/usr/local/tomcat/tomcat1 export TOMCAT_HOME1=/usr/local/tomcat/tomcat1 #tomcat2 export CATALINA_HOME2=/usr/local/tomcat/tomcat2 export CATALINA_BASE2=/usr/local/tomcat/tomcat2 export TOMCAT_HOME2=/usr/local/tomcat/tomcat2 source /etc/profile.d/tomcat.sh 5. Modify the server.xml file in tomcat2 to ensure that each tomcat instance configuration does not have duplicate port numbers. vim /usr/local/tomcat/tomcat2/conf/server.xml <Server port="8006" shutdown="SHUTDOWN"> #22 line, modify Server port, default is 8005 -> change to 8006 <Connector port="8081" protocol="HTTP/1.1" #69 line, change the Connector port, HTTP/1.1 default is 8080 -> change to 8081 <Connector port="8010" protocol="AJP/1.3" redirectPort="8443" /> #116 line, change Connector port AJP/1.3, default is 8009 -> change to 8010 6. Modify the startup.sh and shutdown.sh files in each tomcat instance and add tomcat environment variables vim /usr/local/tomcat/tomcat1/bin/startup.sh # ----------------------------------------------------------------------------- # Start Script for the CATALINA Server # ----------------------------------------------------------------------------- ##Add the following content export CATALINA_BASE=$CATALINA_BASE1 export CATALINA_HOME=$CATALINA_HOME1 export TOMCAT_HOME=$TOMCAT_HOME1 vim /usr/local/tomcat/tomcat1/bin/shutdown.sh # ----------------------------------------------------------------------------- # Stop script for the CATALINA Server # ----------------------------------------------------------------------------- export CATALINA_BASE=$CATALINA_BASE1 export CATALINA_HOME=$CATALINA_HOME1 export TOMCAT_HOME=$TOMCAT_HOME1 vim /usr/local/tomcat/tomcat2/bin/startup.sh # ----------------------------------------------------------------------------- # Start Script for the CATALINA Server # ----------------------------------------------------------------------------- export CATALINA_BASE=$CATALINA_BASE2 export CATALINA_HOME=$CATALINA_HOME2 export TOMCAT_HOME=$TOMCAT_HOME2 vim /usr/local/tomcat/tomcat2/bin/shutdown.sh # ----------------------------------------------------------------------------- # Stop script for the CATALINA Server # ----------------------------------------------------------------------------- export CATALINA_BASE=$CATALINA_BASE2 export CATALINA_HOME=$CATALINA_HOME2 export TOMCAT_HOME=$TOMCAT_HOME2 7. Start /bin/startup.sh in each tomcat /usr/local/tomcat/tomcat1/bin/startup.sh /usr/local/tomcat/tomcat2/bin/startup.sh netstat -natp | grep java This is the end of this article about Tomcat multi-instance deployment. For more relevant content about Tomcat multi-instance deployment, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Example of using @media responsive CSS to adapt to various screens
>>: MySQL aggregate function sorting
MySQL supports nested transactions, but not many ...
Introduction MySQL slow query log is an important...
They are all web page templates from the foreign ...
This article shares the specific code of vue unia...
1. Overview Zabbix is a very powerful and most ...
There are two ways to expose container ports in d...
Table of contents Preface Add sudo write permissi...
Preface: In some previous articles, we often see ...
lead Some common triangles on web pages can be dr...
1Several common character sets In MySQL, the most...
First, I will give you the VMware 14 activation c...
1. Update the yum source The PostgreSQL version o...
Table of contents 1. Maven Dependency 2. Menu rel...
This article example shares the specific code of ...
Table of contents Problem 1: Destruction 1. How t...