sun2
sun2

Reputation: 1158

Not able to configure mod_JK in HTTPD.CONF file for load balancing

I am not able to configure the apache load balancer with mod_jk. Each time I channge httpd.conf file apache server doesnot start.

Here is the scenario: I have 2 apache tomcat instance, Tomcat and tomcat2 and both are running on different ports. I would like to establish a load balancer for these two instances with apache mod_jk:

I have downloded mod_jk.so file and places in modules folder. Below configuration I am trying to httpd.conf file:

LoadModule jk_module modules/mod_jk.so 
AddModule mod_jk.c
JkWorkersFile conf/workers.properties
JkLogFile log/httpd/mod_jk.log
JkLogLevel info
mod_jk loadbalancer
JkMount /examples/* loadbalancer

Here is my workers.propertise file:

# Define list of workers that will be used
worker.list=loadbalancer
# Define Node1
worker.node1.port=8009
worker.node1.host=localhost
worker.node1.type=ajp13
worker.node1.lbfactor=1
worker.node1.cachesize=10
# Define Node2
worker.node2.port=8010
worker.node2.host=localhost
worker.node2.type=ajp13
worker.node2.lbfactor=1
worker.node2.cachesize=10
# Load-balancing behaviour
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

I am not sure, what is wrong here. May be I am adding the mod_jk conf in httpd.conf file at wrong place. Can anybody guide. Any sample working HTTPD.CONF file will be great.

Thanks you for the help.

-Santosh

Upvotes: 1

Views: 2269

Answers (2)

user2586987
user2586987

Reputation: 21

JkWorkersFile "conf/workers.properties" this should be this way and also do check for the mod_jk compatibility.

Upvotes: 0

sun2
sun2

Reputation: 1158

Issue resolve: I was using the mod_jk.so file compatible with apache version 2.0 and Apache webserver 2.2. I have downloaded the mod_jk.so file compatible for 2.2 version and now everything is working fine.

You can check detailed error by option: c:/your_apache_dir/bin> httpd.exe -D mod_jk

Thanks for your help.

Upvotes: 1

Related Questions