Installation guide
# Simple worker configuration file
# Mount the Servlet context to the ajp13 worker
/jmx-console=loadbalancer
/jmx-console/*=loadbalancer
/web-console=loadbalancer
/web-console/*=loadbalancer
d. In HTTPD_DIST/conf/mod-jk.conf, append the following directive.
# You can use external file for mount points.
# It will be checked for updates each 60 seconds.
# The format of the file is: /url=worker
# /examples/*=loadbalancer
JkMountFile conf/uriworkermap.properties
3.1. Configure worker nodes in mod_jk
Task: Configure mod_jk Worker Nodes
Complete this task to configure two mod_jk worker node definitions in a weighted round-robin
configuration with sticky sessions active between two servlet containers.
Prerequisit es
Understand the format of the workers.properties directives, as specified in Appendix A, Reference:
workers.properties.
1. Navigate to HTTPD_DIST/conf/.
2. Create a file named workers.properties.
3. Append the following information to workers.properties.
# Define list of workers that will be used
# for mapping requests
worker.list=loadbalancer,status
# Define Node1
# modify the host as your host IP or DNS name.
worker.node1.port=8009
worker.node1.host=node1.mydomain.com
worker.node1.type=ajp13
worker.node1.ping_mode=A
worker.node1.lbfactor=1
# Define Node2
# modify the host as your host IP or DNS name.
worker.node2.port=8009
worker.node2.host=node2.mydomain.com
worker.node2.type=ajp13
worker.node2.ping_mode=A
worker.node2.lbfactor=1
# Load-balancing behavior
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.sticky_session=1
# Status worker for managing load balancer
worker.status.type=status
3.2. Configuring JBoss to work with mod_jk
Task: Configure JBoss Enterprise Applicat ion Platform to Operat e Using mod_jk
Complete this task to correctly prepare a JBoss Enterprise Application Platform instance on a clustered
node to receive forwarded requests from the mod_jk load balancer.
Repeat this task for each server instance you require, observing the warnings at each step.
Prerequisit es
Complete T ask: Configure mod_jk Worker Nodes.
1. Navigate to the location of the clustered server instance.
2. Open JBOSS_EAP_DIST/jboss-as/server/PROFILE/deploy/jbossweb.sar/server.xml.
14 Chapter 3. Configure load balancing using Apache and mod_jk