A multiple instances deployment layout offers several benefits:
- The ability to quickly deploy multiple instances from a single shared binaries (CATALINA_HOME) Tomcat distribution version.
- The ability to easily upgrade all Tomcat instances by upgrading a single shared binaries (CATALINA_HOME) Tomcat distribution version.
- A more flexible and manageable instance.
This article provides information on deploying ASF Tomcat 6.0.35 on Windows OS.
To install and configure a Tomcat instance on Windows OS:
- Download ASF Tomcat core binary distribution.
Caution: Do not use the Windows service Installer, as it is not flexible for setting up multiple instances.
- Unzip the apache-tomcat-6.0.35-windows-x86.zip contents to C:\opt\apache-tomcat-6.0.35.
Note: You can install tomcat into another folder side c:\opt.
- Create a Tomcat instance base folder:
- Copy the bin, webapps, and conf folders from:
apache-tomcat-6.0.35 to tc6035-example1
- Create the empty temp, logs, work, and lib folders in:
- Copy the setenv.bat (attached to this article) to tc6035-example1\bin folder, or create your own setenv.bat.
- Modify these variables in setenv.bat to match your Tomcat deployment instance environment:
CATALINA_BASE=C:\opt\instances\tc6035-example1 (If not set, it defaults to CATALINA_HOME)
JAVA_HOME=C:\path\to\your\JDK or JRE_HOME=C:\path\to\your\JRE
If not set, it looks for one in system profile.
Make any other custom JVM options change to setenv.bat if necessary. You may also need to re-configure your Tomcat server.xml connector ports, shutdown port, and make sure they are not already in use by other server instances.
- Use this script to stop the Tomcat instance in console mode:
You can now deploy as many Tomcat instances as your platform can handle by copying the tc6035-example1 to tc6035-example2,tc6035-example3..n. You must always update each new instance's setenv.bat and server.xml files.
Note: A Tomcat instance is typically run as a Windows service. For information on running Tomcat as NT service, see Running a Tomcat instance as a Windows service.
- For more information on using Java Service Wrapper for running Tomcat, see http://yajsw.sourceforge.net/.
- For more information on deploying Tomcat using a multi-instance layout on Linux, see How to deploy ASF Tomcat using multi instances layout on Linux.