In order to achieve server upgrade without affecting user use, it is necessary to configure two tomcats in one or more servers. The following describes the process of configuring two Tomcats on the same server.
The steps are as follows:
1. Copy the original Tomcat to another directory, such as tomcat-8090, clear the logs directory
2. Modify the server.xml file in Tomcat, and change the shutdown and Connector ports to another one. Value, such as 8006/8090
3. Modify the startup.sh and shutdown.sh files and add in the first line:
export CATALINA_HOME=/opt/app/tomcat-8090
4. Start tomcat
5. Configure load balancing in Nginx:
Nginx configuration file, add:
upstream tomcatCluster {
server
server
{
listen 80;
, ;
location ~* /The above introduces how to deploy two Tomcats on the same server and use Nginx to achieve load sharing, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.