Technical Recipes

How to use mod_jk connector on Windows

Assume that you have installed and configured the Tocmat application server instance 'data-example1' on your local Windows under $CATALINA_HOME directory under port 6612. This section discuss about how to configure Apache HTTPD server with mod_jk connector to connect to Tomcat instances.

1. Create a workers.properties file if not exists
	under the /conf of Apache HTTPD server installation or instance

2. Add or Modify workers.properties file

	2.1 Define 1 real worker using ajp13
	
	worker.list=worker1
	
	2.2 Set properties for worker1
	
	worker.worker1.type=ajp13
	worker.worker1.host=localhost
	worker.worker1.port=6612
	worker.worker1.lbfactor=1
	
	2.3 Create load balancing worker properties for failover (optional)
	
	worker.balance1.balance_workers=worker1, worker2
	worker.worker1.redirect=worker2
	worker.worker2.activation=disabled
	
3. Modify httpd.conf after create a copy of the original httpd.conf
	
	#
	# Mod_jk settings
	#
	JkWorkersFile "conf/workers.properties"
	JkLogFile "logs/mod_jk1.log"
	JkLogLevel info
	JkMount /example1/* worker1
	JkMount /example1/servlet/* worker1
	# Configuring Apache to serve static web application files
	Alias /manager C:/apache-tomcat-7.0.29/webapps/manager
	<Directory "C:/apache-tomcat-7.0.29/webapps/manager">
	    Options Indexes MultiViews 
	    AllowOverride None 
	    Order allow,deny 
	    Allow from all 
	</Directory>
	JkMount /manager/* worker1
	JkUnMount /manager/images/*.gif worker1
	# End of mod_jk settings
	
	LoadModule  jk_module  modules/mod_jk.so
  	
4. Verify the connection is up
	(Re)start the web server and browse to the http://localhost/example1/