VMware: Deploying ASF Tomcat 6.0 using multi instances layout on Windows OS
search cancel

VMware: Deploying ASF Tomcat 6.0 using multi instances layout on Windows OS

book

Article ID: 297368

calendar_today

Updated On:

Products

Support Only for Apache Tomcat

Issue/Introduction

Symptoms:

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.

Environment


Resolution

To install and configure a Tomcat instance on Windows OS:

  1. Download ASF Tomcat core binary distribution.

    Caution: Do not use the Windows service Installer, as it is not flexible for setting up multiple instances.
     
  2. 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.
     
  3. Create a Tomcat instance base folder:

    C:\opt\instances\tc6035-example1
     
  4. Copy the bin, webapps, and conf folders from:

    apache-tomcat-6.0.35 to tc6035-example1
     
  5. Create the empty temp, logs, work, and lib folders in:

    tc6035-example1
     
  6. Copy the setenv.bat (attached to this article) to tc6035-example1\bin folder, or create your own setenv.bat.
  7. Modify these variables in setenv.bat to match your Tomcat deployment instance environment:

    CATALINA_HOME=C:\opt\apache-tomcat-6.0.35
    CATALINA_BASE=C:\opt\instances\tc6035-example1 (If not set, it defaults to CATALINA_HOME)
    JVM_MODE=-client
    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.
     
  8. Use this script to stop the Tomcat instance in console mode:

    C:\opt\instances\tc6035-example1\bin\{catalina.bat,startup.bat,shutdown.bat}
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.