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
01. Infinity Font Download 02. Banda Font Download...
Table of contents 1. Related binlog configuration...
Table of contents 1. What is JSON 1.1 Array liter...
The computer system is: win7 This article is main...
1. Division of labor and process <br />At T...
1. Use of CSS scope (style division) In Vue, make...
Stored Functions What is a stored function: It en...
Table of contents 1. Script vim environment 2. Ho...
CocosCreator version: 2.4.2 Practical project app...
The solutions to the problems encountered during x...
Pitfalls encountered I spent the whole afternoon ...
1. Horizontal center Public code: html: <div c...
Background Here's what happened, Luzhu accide...
MyISAM, a commonly used storage engine in MySQL c...
Each time tomcat is started, the following log fi...