Configuring Apache Web Server for Tomcat Instances

Perform the following steps to configure Apache web server for each Tomcat instance.

  1. Start the command prompt and enter the following line: SC delete <service-name>
  2. Open a text editor and add the following lines:
    
    "D:\tom_home\Tomcat 7.0A\bin\tomcat7.exe" //IS//Tomcat7A --DisplayName "Apache Tomcat
    7.0A" --Description "Apache Tomcat 7.0.32 Server - http://tomcat.apache.org/" --LogPath "D:\tom_home\Tomcat 7.0A\logs" --Install "D:\tom_home\Tomcat 7.0A\bin\tomcat7.exe" --Jvm " D:\tom_java\jre7\bin\server\jvm.dll" --StartPath "D:\tom_home\Tomcat 7.0A" --StopPath "D:\tom_home\Tomcat 7.0A"
    "D:\tom_home\Tomcat 7.0A\bin\tomcat7.exe" //US//Tomcat7A --Startup auto
    "D:\tom_home\Tomcat 7.0A\bin\tomcat7.exe" //US//Tomcat7A --Classpath
    "D:\tom_home\Tomcat 7.0A\bin\bootstrap.jar" --StartClass org.apache.catalina.startup.Bootstrap -
    -StopClass org.apache.catalina.startup.Bootstrap --StartParams start --StopParams stop -- StartMode jvm --StopMode jvm
    "D:\tom_home\Tomcat 7.0A\bin\tomcat7.exe" //US//Tomcat7A --JvmOptions "- Dcatalina.home=D:\tom_home\Tomcat 7.0A#-Dcatalina.base=D:\tom_home\Tomcat 7.0A#- Djava.endorsed.dirs=D:\tom_home\Tomcat 7.0A\endorsed#- Djava.io.tmpdir=D:\tom_home\Tomcat 7.0A\temp#- Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager#- Djava.util.logging.config.file=D:\tom_home\Tomcat 7.0A\conf\logging.properties"
    "D:\tom_home\Tomcat 7.0A\bin\tomcat7.exe" //US//Tomcat7A --StdOutput auto --StdError auto"
  3. Replace Tomcat7A with the Tomcat instance name you have provided.
  4. Save the file with the Tomcat instance name and with the file extension .bat.
    If your Tomcat instance name is Tomcat A, save the file as TomcatA.bat.
  5. Create similar .bat files for all Tomcat instances modifying the Tomcat instance name wherever necessary.
  6. Open the Httpd.conf file using a Notepad or a text editor.
  7. Uncomment the following lines by removing # found at the beginning of the line:
    LoadModule proxy_module modules/mod_proxy.so 
    LoadModule proxy_ajp_modulemodules/mod_proxy_ajp.so 
    LoadModule proxy_balancer_modulemodules/mod_proxy_balancer.so 
    LoadModule proxy_connect_modulemodules/mod_proxy_connect.so 
    LoadModule proxy_ftp_modulemodules/mod_proxy_ftp.so 
    LoadModule proxy_http_modulemodules/mod_proxy_http.so 
    Include conf/extra/httpd-vhosts.conf 
    
  8. Save and close the file.
  9. Open the httpd-vhosts.conf file using a Notepad or a text editor.
  10. Edit the file providing appropriate values as necessary, including the Tomcat version you are using. Refer to the following image:
  11. Save and close the file.
  12. Create the folder I4V in the Tomcat instances path.
    C:\Tom_App\I4V
  13. Copy the webapps folder (typically found at C:\tom_home\Tomcat 7.0A\webapps, where Tomcat 7.0A is the example of the Tomcat instance folder) to the I4V folder created in the step above.
  14. Copy the I4V.war file to the webapps folder.
  15. Open the Server.xml file, typically found in the location: C:\tom_home\Tomcat 7.0A\conf\Server.xml (Tomcat 7.0A is the example of the Tomcat instance folder).
  16. Change the port numbers for the various Tomcat instances.
    <Server port=”8005” shutdown=”SHUTDOWN”> (8105, 8205, 8305) 
    <Connector port=”8080” protocol=”HTTP/1.1”> (8081, 8082, 8083) 
    <Connector port=”8009” protocol=”AJP/1.3” redirectPort=”8443” /> (8109, 8209, 8309)
  17. Provide the name of the Tomcat instance for the attribute jvmRoute as shown:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="TomcatA">
  18. For each Tomcat instance you have, added the following lines as below and provide the Tomcat instance name value for the jvmRoute attribute:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="TomcatA">
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="TomcatB"> 
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="TomcatC"> 
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="TomcatD">
  19. Uncomment the following clustering tag by removing the preceeding .
    <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
  20. Point to the common WEBAPPS folder by updating as shown:
    <Host name="localhost" appBase="D:\tom_app\I4V\webapps">
  21. Save and close the file.
  22. Restart the Tomcat instances.
  23. Replace the licence.xml file found under the /web-apps/I4V/WEB-INF/config folder with the license.xml file provided with the installation package.
  24. Open the web.xml, typically found in the location: C:\Tom_App\I4V\webapps\I4V\WEB-INF\, using Notepad or a text editor.
  25. Add the following lines:
    </welcome-file-list>
    <distributable/>
    </web-app>
  26. Save and close the file.