This page describes the method to deploy several tomcat instances
1. Install your first instance of Apache Tomcat
Just download an Apache Tomcat Windows Service Installer. Just follow the steps to install.
And I would expect the software to be installed at this directory "C:\Program Files\Apache Software Foundation\Tomcat x.y".
Default installation should be as :
Remark : in the following parts, we will call %CATALINA_HOME% the install root directory
2. Duplicate Tomcat configuration
A tomcat instance base structure must be deployed into other directories
|
3- Configure the apache tomcat instances
By default, Apache Tomcat installer configured serval ports. For example Connector Port, Shutdown Port, AJP(Apache JServ Protocol) Connection Port & Redirect Port, to run the service.
In order to get multiple Tomcat instances running on a single machine, we need to configure the ports on each instance by modifying for each Tomcat node, the file "%CATALINA_HOME%\N01\conf\server.xml" as :
Connector Port: 8080 is the default port where Apache Tomcat listen to HTTP request.
Use your expected one by changing the port number identified with the following tag :<connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
Shutdown Port: 8005 is the port used to shutdown the Apache Tomcat.
Use your expected one by changing the port number identified with the following tag :<server port="8005" shutdown="SHUTDOWN">
AJP (Apache JServ Protocol) Connector Port: The Apache JServ Protocol (AJP) is a protocol that conduct inbound requests from a web server to an application server that sits behind the web server.
Use your expected one by changing the port number identified with the following tag :<connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
Redirect Port: Any redirection happening inside Apache Tomcat will happen through this port. In the server.xml, there are two places mentioned the redirectPort.
Use your expected one by changing the port number identified with the following tag :<connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> <connector port="8100" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
4. Install Windows Services
To start a Tomcat instance, we need to create a Windows Service which quick start the instance by supplying corresponding parameters.
|
C:\>set CATALINA_HOME=C:\Program Files\Apache Software Foundation\Tomcat 7.0 C:\>set CATALINA_BASE=C:\Program Files\Apache Software Foundation\Tomcat 7.0\N01 C:\>set JAVA_HOME=C:\Program Files\Java\jre6 C:\>"%CATALINA_HOME%\bin\tomcat7.exe" //IS//N01 --DisplayName="Tomcat N01" --Startup auto --Install="%CATALINA_HOME%\bin\tomcat7.exe" --JavaHome="%JAVA_HOME" --Classpath="%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_HOME%\bin\tomcat-juli.jar" --JvmOptions="-Dcatalina.home=%CATALINA_HOME%" --JvmOptions="-Dcatalina.base=%CATALINA_BASE%" --JvmOptions="-Djava.endorsed.dirs=%CATALINA_BASE%\endorsed" --JvmOptions="-Djava.io.tmpdir=%CATALINA_BASE%\temp" --JvmOptions="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" --JvmOptions="-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties" --LogPath="%CATALINA_BASE%\logs" --StdOutput="auto" --StdError="auto" --StartMode=jvm --StartClass=org.apache.catalina.startup.Bootstrap --StartParams=start --StartPath="%CATALINA_BASE%" --StopMode=jvm --StopClass=org.apache.catalina.startup.Bootstrap --StopParams=stop --StopPath="%CATALINA_BASE%"
In order to check or edit your settings, you can edit the new service with this command line
C:\>"%CATALINA_HOME%\bin\tomcat7w.exe" //ES//N01