tomcat connector readme
1. download tomcat-connectors-1.2.32-src.tar.gz
from http://tomcat.apache.org/download-connectors.cgi
2. tar -zxvf tomcat-connectors-1.2.32-src.tar.gz
3.
yum install gcc-c++
cd native
./configure –with-apxs=/usr/sbin/apxs (or where ever the apxs/apxs2 is)
don’t copy this line, type it by manual
# ./configure –with-apxs=/usr/sbin/apxs –with-tomcat=/usr/local/tomcat6 –with-java-home=/usr/java/latest/bin/java
if got errors run yum install gcc-c++
make
make install
mod_jk.so is in /usr/lib/httpd/modules
or in tomcat-connectors-1.2.36-src/native/apache-2.0
4. update httpd.conf
LoadModule jk_module modules/mod_jk.so
5. 在 /etc/httpd/conf.d 目錄下增加 mod_jk.conf 設定檔
[mod_jk.conf 檔案內容]
JkWorkersFile /etc/httpd/conf.d/workers.properties
JkLogFile /var/log/jk.log
JkShmFile /var/log/jk-runtime-status
JkLogLevel info
JkMount /*.jsp loadbalancer
JkMount /servlet/* loadbalancer
6. create conf/workers.properties
# list the workers by name
worker.list=loadbalancer,worker1
# localhost server 1
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor = 1
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=worker1
7. 如果需要SSL, 需要配置 conf/extra/httpd-ssl.conf,
找到virtual host: 443, 加入两行代码
JkMount /*.jsp loadbalancer
JkMount /servlet/* loadbalancer