Apache web server multiple workers

2.5k views Asked by At

We have a webserver running apache 2.2, which connects to tomcat 5.5 in another server (say, repserver). This is done through ajp1.3 protocol, with mod_jk workers.properties file defining an ajp13 worker.

The workers.properties file contains:

ps=\
worker.ajp13.type=ajp13
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=#HOSTNAME

The httpd.conf file is using these three lines:

JkMount /* ajp13
JkMount /#Link1/* ajp13
JkMount /#Link2/* ajp13

Now we have another instance of tomcat 7 in the repserver, and we need the webserver to connect to this instance as well. I have defined the listening port for ajp as 9009 in this instance of tomcat. This contains link3 and link4.

How can I define another worker to connect to these links?

1

There are 1 answers

0
Stefan On

You need to define a load balancer in that case:

Change your workers.properties to this:

worker.list=balancer

#lb config
worker.balancer.type=lb
worker.balancer.sticky_session=1
worker.balancer.balance_workers=ajp13,tomcat7

#(ajp13 is not a good name for a worker/server node)
worker.ajp13.type=ajp13
worker.ajp13.port=8009
worker.ajp13.host=#HOSTNAME

worker.tomcat7.type=ajp13
worker.tomcat7.port=9009
worker.tomcat7.host=#IP/HOSTNAME

Open server.xml of Tomcat 7 and define the jvmRoute (do that in Tomcat 5 too, if not still happend):

<Engine jvmRoute="tomcat7" name="Catalina" ...>

Map applications to the new Tomcat 7:

JkMount /APPLICATION_NAME   balancer
JkMount /APPLICATION_NAME/* balancer