1. install httpd
2. install tomcate
3. download mod_jk
4. config it
on centos u need install libtool and apxs
sudo yum install httpd-devel
sudo yum install libtool
5.
cd PATH_TO_JK/jk/native
./buildconf.sh
./config --with-apxs=/usr/sbin/apxs
make
cd apache2.0
cp mod_jk.so /ect/httpd/modules/
6. configuring apache and tomcate
touch /etc/httpd/workers.properties
workers.tomcat_home=/usr/lib/apache-tomcat
workers.java_home=/usr/lib/jdk
ps=/
worker.list=worker1
worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1
7. Now we need to open the /etc/httpd/httpd.conf file and add the following lines at the bottom
LoadModule jk_module modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile /etc/httpd/workers.properties
# Where to put jk logs
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# Send servlet for context /your-context to worker named worker1
JkMount /jsp-examples worker1
# Send JSPs for context /your-context/* to worker named worker1
JkMount /your-context/* worker1