A Unique Developer

Load balancing with Apache Tomcat on ColdFusion standard version

This one is actually part-ii of my first blog “Running multiple tomcat instances with Coldfusion standard version” but to make it more meaningful I have changed title of this Post.

In previous post we have run single site on two instance of tomcat and on different port. Now time to run both instance under single website URI with load balancing for high availability under Apache server.

Let's install Apache http server using downloaded .msi, to avoid security issue and spacing in path I prefer to install “C:\Apache2.2” [APACHE_HOME] and make sure it is pointing to port 80. Once finish with installing browse URL http://localhost to make sure Apache server is configured and running correctly. To perform load balancing on two tomcat instance download mod_jk. Use Binary releases link and choose your appropriate platform and download file Copy it to APACHE_HOME/modules folder and rename it to

Open httpd.conf file from APACHE_HOME/conf folder and copy below text after last LoadModule statement.

LoadModule jk_module modules/

Create file under APACHE_HOME/conf and open it in text editor. Paste below code in it and save file.


Name worker1 and worker2 was defined in server.xml of tomcat’s configuration file (remember <Engine name="Catalina" defaultHost="railosite1.local" jvmRoute="worker1">) and port is setup for AJP/1.3 connector.

Save file and open httpd.conf file again. Copy below code in httpd.conf file under last LoadModule statement we have inserted.

# Path to workers.propertiesJkWorkersFile c:/apache2.2/conf/ Path to jk logsJkLogFile c:/apache2.2/mod_jk.log# Jk log level [debug/error/info]JkLogLevel info# Jk log formatJkLogStampFormat "[%a %b %d %H:%M:%S %Y] "# JkOptions for forwardingJkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories# JkRequestLogFormat set the request formatJkRequestLogFormat "%w %V %T"JkMount / balancerJkMount /* balancer

Save your file and restart apache server. Now you should able to browse http://cfsite.local (No port number needed anymore).

Now stop first tomcat instance service and keep second instance running and vice versa. You will find in both cases our site is running as Apache will transfer request to running instance. If you are managing login in session variable then you may need to relogin because we are not performing session sharing.

I didn’t get much success in sharing session between two instance of ColdFusion, will post it if I get success in this.
Hope you guys find this helpful.