Configure Apache Tomcat Load-Balancing

The following procedure demonstrates one way you can configure your Apache Tomcat server to use load-balancing that can be exploited by the  Web Services component.
The following procedure demonstrates one way you can configure your Apache Tomcat server to use load-balancing that can be exploited by the
CA Endevor
Web Services component.
The procedure in this article is neither a recommended best practice nor an exhaustive guide to setting up load-balancing in all environments. As an alternative to Web Services, you can also use the CA Brightside API Mediation Layer (API ML) Gateway to configure Apache Tomcat to use load-balancing.
Follow these steps:
  1. Download and install the Apache HTTP Server (HTTPD). HTTPD acts as a load-balancer and can be placed off the mainframe.
    For information about how to install HTTPD, including Windows-specific instructions, see the Apache HTTP Server website.
  2. Download the
    extension for HTTPD from the "Tomcat Connectors (mod_jk) Downloads" section of the Apache Tomcat website.
    Ensure that the
    module for your operating system is downloaded into the
    folder of HTTPD.
  3. Edit
    in the Apache HTTPD
    folder by adding the following line:
    LoadModule jk_module modules/
  4. Set up AJ13 connectors on the load-balanced Apache Tomcat servers. For each Tomcat server that hosts
    CA Endevor
      Web Services, edit the
    file that is located in the
    folder to add an AJP13 connector.
    Example: Edited server.xml file
    <Connector port="
    " protocol="AJP/1.3" redirectPort="8443" maxThreads="150"> </Connector>
    If you have HTTPS set up, copy your HTTPS-enabled connector settings, change the protocol to "AJP/1.3", and either assign a new port or disable the existing connector in order to free up that port.
  5. Set up the configuration file worker:
    1. Create the file
      in the
      folder of HTTPD.
    2. Modify the
      file by adding load-balancer settings and pointing to the
      Example: Edited load-balancer settings in httpd.conf file
      # Load balancer settings JkWorkersFile C:\ApacheHTTPD\Apache24\conf\ JkShmFile C:\ApacheHTTPD\Apache24\logs\mod_jk.shm JkLogFile C:\ApacheHTTPD\Apache24\logs\mod_jk.log JkLogLevel error JkMount /status status JkMount /* balancer JkOptions +ForwardURIProxy JkOptions +ForwardURICompatUnparsed
      Three options are available to ensure that the logs forwarded by HTTPD are left with the original Tomcat URL:
      JkOptions +ForwardURIProxy
      The forwarded URI is partially reencoded after processing inside Apache and before forwarding to Tomcat. This option is compatible with local URL manipulation by
      and with URL-encoded session IDs.
      JkOptions +ForwardURICompatUnparsed
      The forwarded URI is unparsed, and is spec-compliant and secure. This option always forwards the original request URI, so rewriting URIs with
      and then forwarding the rewritten URI does not work.
      JkOptions ForwardURICompat
      The forwarded URI is decoded by Apache. Encoded characters are decoded and explicit path components such
      are already resolved. This option is less spec-compliant and is not safe if you are using prefix
      . This option allows the rewriting of URIs with
      before forwarding.
      Message files are exempt from load-balancing.
    3. Edit the
      file by setting up one worker per mainframe Tomcat instance that you want to load-balance.
      Example: Edited file
      worker.list=balancer,status worker.tomcat1.type=ajp13 worker.tomcat1.port=AJP13 port of 1st tomcat name of 1st tomcat worker.tomcat2.type=ajp13 worker.tomcat2.port=port of 2nd tomcat host name of 2nd tomcat worker.balancer.type=lb worker.balancer.balance_workers=tomcat1, tomcat2 worker.status.type=status
      For more information about setting up the worker configuration file, see the "Apache HTTP Server HowTo" section of the Apache Tomcat Connectors documentation.
  6. Start all the servers and direct all
    CA Endevor
    REST API requests to the HTTPD server to make use of load-balancing.
    The default URL for accessing the REST API is the same URL that is used for direct access to Tomcat: