Very Easy Setting Mod_jk

Why I write this post is I spend a lot of my time to setting up Apache and Tomcat7 width Mod_jk
There are lots of posts on website But proper to my computer setting
I Hope this guide to save your time
yum remove httpd
yum install httpd httpd-devel
after httpd installed
you have to download tomcat-connectors.
the version what i installed is tomcat-connectors-1.2.35-src
cd native
./configure --with-apxs=/usr/sbin/apxs
make
make install

you can find mod_jk.so /etc/httpd/modules
### Mod_jk : connect tomcat ####

httpd.conf add below
LoadModule jk_module modules/mod_jk.so

JkWorkerProperty worker.list=ajp13w
JkWorkerProperty worker.ajp13w.type=lb
JkWorkerProperty worker.ajp13w.balanced_workers=WAS1,WAS2
JkWorkerProperty worker.sticky_session=true

JkWorkerProperty worker.WAS1.type=ajp13
JkWorkerProperty worker.WAS1.host=localhost
JkWorkerProperty worker.WAS1.port=8009
JkWorkerProperty worker.WAS1.socket_timeout=3
JkWorkerProperty worker.WAS1.prepost_timeout=1000
JkWorkerProperty worker.WAS1.connect_timeout=1000
JkWorkerProperty worker.WAS1.lbfactor=1

JkWorkerProperty worker.WAS2.type=ajp13
JkWorkerProperty worker.WAS2.host=192.168.0.32
JkWorkerProperty worker.WAS2.port=8009
JkWorkerProperty worker.WAS2.socket_timeout=3
JkWorkerProperty worker.WAS2.prepost_timeout=1000
JkWorkerProperty worker.WAS2.connect_timeout=1000
JkWorkerProperty worker.WAS2.lbfactor=1

JkLogFile logs/jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
#JkMount /*.jsp ajp13w
JkMount /* ajp13w
JkMount /example/* ajp13w

JkUnMount /*.html ajp13w
JkUnMount /*.txt ajp13w
JkUnMount /*.gif ajp13w
JkUnMount /*.jpg ajp13w
#JkMount /servlet/* ajp13w
apache mpm should use worker.
basic setting is prefork
[root@node1 httpd]# apachectl -l
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c


/etc/sysconfig/httpd
#HTTPD=/usr/sbin/httpd.worker remove #

[root@buy-0936 sysconfig]# apachectl -l
Compiled in modules:
core.c
worker.c
http_core.c
mod_so.c

You finally success mod_jk. If you have Question Reply~!

Comments

Popular posts from this blog

Project euler 169 found clue

Floyd-Warshall's algorithm