The next version of windows create multiple instances of tomcat

He did so successfully, and record it, the original address: https://my.oschina.net/stategrace/blog/202431

First, download a tomcat we create a letter in any folder, below tomcat1, tomcat2, tomcat3, etc.

Copy the tomcat conf to tomcat1, tomcat2, tomcat3, in

Three ports modify server.xml configuration file, not duplicate, that is

<Server port="8005" shutdown="SHUTDOWN">
<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

8005,8080,8009, plus up to 10 can 8015,8090,8019 8025,8100,8029 three components and three

Let's write three scripts were placed tomcat1, tomcat2, tomcat3 in three scripts are startup, shutdown, restart script

My tomcat directory setD: \ Program Files \ Tomcat \ apache-tomcat-8.0.3

The first script startup.bat, startup scripts

OFF @echo 
IF "% OS%" == "Windows_NT" setlocal 
REM ---------------------------------- ----------------------------------------- 
REM CATALINA service startup script 
rem --- -------------------------------------------------- ---------------------- 
REM definitions CATALINA_BASE and CATALINA_HOME. CATALINA_BASE: current directory, CATALINA_HOME: tomcat directory 
the SET "CATALINA_HOME = D: \ Program Files \ Tomcat \ the Apache-Tomcat-8.0.3" 
the SET "CATALINA_BASE =% cd%" 
REM set the startup file 
set "TOMCAT_START =% CATALINA_HOME% \ bin \ startup.bat " 
REM startup file 
Call"% TOMCAT_START% " 
: End

The second script shutdown.bat, startup scripts

OFF @echo 
IF "% OS%" == "Windows_NT" setlocal 
REM ---------------------------------- ----------------------------------------- 
REM CATALINA service shutdown script 
rem --- -------------------------------------------------- ---------------------- 
REM definitions CATALINA_BASE and CATALINA_HOME. CATALINA_BASE: current directory, CATALINA_HOME: tomcat directory 
the SET "CATALINA_HOME = D: \ Program Files \ Tomcat \ the Apache-Tomcat-8.0.3" 
the SET "CATALINA_BASE =% cd%" 
REM is set to close the file 
set "TOMCAT_DOWN =% CATALINA_HOME% \ bin \ shutdown.bat " 
REM close file 
Call"% TOMCAT_DOWN% " 
: End

The third script restart.bat, startup scripts

@echo off
if "%OS%" == "Windows_NT" setlocal
rem ---------------------------------------------------------------------------
rem CATALINA服务重启脚本
rem ---------------------------------------------------------------------------
set "CURRENT_DIR=%cd%"
call "%CURRENT_DIR%"/shutdown.bat
call "%CURRENT_DIR%"/startup.bat
:end

Of course, all three can create a script to loop through the outermost layer of the following documents, to start once all

 

 

If you want to deploy unified only need to modify the server.xml on it, here is my definition of the directory to the webapps below, then we do a load balancing on a lot easier, tomcat after upgrade on the convenience, to directly modify the original directory under change you can just put in a directory application upgrade on it

<Host name="localhost"  appBase="D:\\webapps"
            unpackWARs="true" autoDeploy="true">

Optimization: In fact, you can configure the CATALINA_HOME environment variable, so do not need to write the full address of each file, and later changed environment variable on it

 

Guess you like

Origin www.cnblogs.com/margin-gu/p/11125578.html