Configure Multiple Tomcat Servers

You can install two or more Tomcat servers, either on one machine or on different machines. If you install on one machine, you can define the default host as localhost.

  1. Install Uniface twice. By default, each installation includes a Tomcat server, configured to run on a specific port number.
  2. Modify the server.xml for both servers, defining the JVM route and ports. Each server must have its own port number, but no HTTP port is required, since the Web server responds to these requests, not Tomcat.
    • Server 1:
      <!-- Define the JVM route -->
      <Engine jvmRoute="tomcat1" name="Standalone" defaultHost="localhost" debug="0">
      
      <!-- Define a server port: -->
      <Server port="11005" shutdown="SHUTDOWN" debug="0">
      <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
      port="11009" minProcessors="5" maxProcessors="75"
      acceptCount="10" debug="0"/>
      
      <!-- Disable the HTTP port: -->
      <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
      <!--
      <Connector className="org.apache.catalina.connector.http.HttpConnector"
      port="8080" minProcessors="5" maxProcessors="75"
      enableLookups="true" redirectPort="8443"
      acceptCount="10" debug="0" connectionTimeout="60000"/>
      -->
      <!-- Define an Apache-Connector Service -->
      <Service name="Tomcat-Apache">
      <!--
      <Connector className="org.apache.catalina.connector.warp.WarpConnector"
      port="8008" minProcessors="5" maxProcessors="75"
      enableLookups="true" appBase="webapps"
      acceptCount="10" debug="0"/>
      -->
      
    • Server 2:
      <!-- Define the JVM route -->
      <Engine jvmRoute="tomcat2" name="Standalone" defaultHost="localhost" debug="0">
      
      <!-- Define a server port: -->
      <Server port="12005" shutdown="SHUTDOWN" debug="0">
      <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
      port="12009" minProcessors="5" maxProcessors="75"
      acceptCount="10" debug="0"/>
      
      <!-- Disable the HTTP port: -->
      <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
      <!--
      <Connector className="org.apache.catalina.connector.http.HttpConnector"
      port="8080" minProcessors="5" maxProcessors="75"
      enableLookups="true" redirectPort="8443"
      acceptCount="10" debug="0" connectionTimeout="60000"/>
      -->
      <!-- Define an Apache-Connector Service -->
      <Service name="Tomcat-Apache">
      <!--
      <Connector className="org.apache.catalina.connector.warp.WarpConnector"
      port="8008" minProcessors="5" maxProcessors="75"
      enableLookups="true" appBase="webapps"
      acceptCount="10" debug="0"/>
      -->
      
  3. For each Uniface installation, copy the uniface subdirectory under UnifaceAPSInstallDir\uniface\webapps to the webapps directory of a Tomcat installation.
  4. For each Tomcat server, modify the web.xml file located under TomcatInstallDir\webapps\uniface\WEB-INF\ to point to the correct Uniface Router:
    • Server 1:
      <param-value>
      UV8:localhost+13001|Server1\userver|userver|wasv1
      </param-value>
    • Server 2:
      <param-value>
      UV8:localhost+13001|Server2\userver|userver|wasv2
      </param-value>