Sunday, 22 May 2011

Configure mod_jk – Part II. workers.properties

Configure workers.properties
cd /etc/httpd/conf
vi workers.properties
(and paste this)
# This is a basic workers.properties file from The Cool Server
worker.list=wlb,jkstatus,ajp13
worker.ajp13.type=ajp13
worker.ajp13.host=localhost
worker.ajp13.port=8009
worker.wlb.type=lb
worker.wlb.balance_workers=ajp13
worker.jkstatus.type=status


Set file permissions for workers.properties
chown root:bin /etc/httpd/conf/workers.properties
chmod 644 /etc/httpd/conf/workers.properties


Test mod_jk
service httpd restart

If you don’t get any errors than mod_jk is running normaly.

You will still have to tell Apache HTTPD to USE it for each Virtual Host / Web Application.
You should enable mod_jk in each Virtual Host that needs this and you should have a Host in Tomcat’s server.xml for each application that is connected with mod_jk.
Here is how to create a Virtual Host in Apache HTTPD (remember to uncomment the JKMount line)
Here is how to create a Host in Apache Tomcat.
Don’t forget to restart both of them :)

No comments:

Post a Comment