Configure multiple instance Tomcat deployments
Apache Tomcat is an open source software product that creates both a Web and application server for your enterprise. The software provides a Web container that enables Java servlets and Run pages, which support Java code running along with a Web server. You can run multiple-instance Tomcat deployments on Linux installations.
Before you install Tomcat, perform the following procedures on your Linux server:
-
Download a supported version of Apache Tomcat from the Apache Tomcat Core 7 website.
See the system requirements to verify the supported Tomcat version for your Web Help Desk version.
-
Unzip the files to a directory you create on your Tomcat server running Linux.
For example:
/cluster/apache-tomcat-9.0.43
This location will be referred to as
template_tomcat_home_directory
in this procedure. -
In your
<template_tomcat_home_directory>/bin
directory, add the execution privilege to all scripts using the following command:chmod 744 template_tomcat_home_directory/bin/*.sh
This command does not apply for Apache Tomcat Core 8.
-
Download the Apache httpd server version for your operating system from the Apache HTTP Server Project site.
See Compiling and Installing at the Apache HTTP Server Project Website for information about installing HTTP Server.
- Install Apache httpd server using yum search and install commands.
-
Install the latest version of SolarWinds Web Help Desk for Linux from the rpm package.
The default installation directory is:
/user/local/webhelpdesk
This location will be known as
<whd_home>
in this procedure. - Start Web Help Desk.
- Connect to the appropriate database.
- Ensure that Web Help Desk is operating efficiently.
- Stop Web Help Desk.
Install multiple tomcat instances
You can create multiple Tomcat instances that point to the <tomcat_home>/webapps
directory. These Tomcat instances run as separate processes with their own long files, port numbers, and resources.
-
Copy the
template_tomcat_home_directory
instance to/cluster
as aTomcat1
directory.This directory will be referred to as
TOMCAT_1_HOME
in this procedure. -
Add execute privileges to all scripts in the
TOMCAT_1_HOME
directory.Execute:
chmod 744 tomcat_1_home/bin/*sh
-
Remove the
<TOMCAT_1_HOME>webapps
directory.Execute:
rm -rf TOMCAT_1_HOME/webapps
-
Create a webapps soft link in the
<TOMCAT_1_HOME>
directory pointing to<template_tomcat_home_directory>/webapps
.Execute:
In -s template_tomcate_home_directory/webapps/ webapps
-
Update the
TOMCAT_1_HOME/conf/server.xml
file to avoid port conflicts.Update the default values listed below:
<Server port="8005" shutdown="SHUTDOWN">
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker1">
to the following values:
<Server port="8100" shutdown="SHUTDOWN">
<Connector port="8200" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker2">
If these ports are reserved, use another set of ports. SolarWinds recommends having a consistent port numbering convention to avoid conflicts.
-
Add the following value:
<Connector port="8300" protocol="AJP/1.3" redirectPort="8443"/>
-
Update the
TOMCAT_1_HOME logback-config
.xml file so it points to a correct log directory.Execute:
<File>TOMCAT_1_HOME/logs/whd-spring.log</File>
<fileNamePattern>TOMCAT_1_HOME/logs/whd-spring.%d{yyyy-MM-dd}.log</fileNamePattern>
-
Update the
catalina.sh
script in theTOMCAT_1_HOME/bin
directory to accommodateTOMCAT_1_HOME
port changes in the server.xml file and modifyactivemq.broker.port
to avoid conflicts.Update the script as follows:
-Djava.endorsed.dirs=TOMCAT_1_HOME/webapps/endorsed
-DWHDconfig=TOMCAT_1_HOME/webapps/.whd.properties
-Dlogback.configurationFile=TOMCAT_1_HOME/logback-config.xml
-DWHDPort=8200
-DWHDPrivateBaseUrl=http://localhost:8200
-Dactivemq.broker.port=61618
-
Edit the Apache
httpd.conf
file, adding a new worker.Update the default values listed below:
<Proxy balancer://cluster>
BalancerMember http://localhost:8080 loadfactor=1 route=worker1
ProxySet lbmethod=byrequests stickysession=JSESSIONID|jsessionid|wosid
</Proxy>
to the following values:
<Proxy balancer://cluster>
BalancerMember http://localhost:8080 loadfactor=1 route=worker1
BalancerMember http://localhost:8200 loadfactor=1 route=worker2
ProxySet lbmethod=byrequests stickysession=JSESSIONID|jsessionid|wosid
</Proxy>
- Restart the Apache httpd service and both Tomcat instances.
- Start Web Help Desk.