worker.properties
ps=/
worker.list=worker1
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.connection_pool_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.lbfactor=1
mod_jk.properties
# 指出mod_jk模块工作所需要的工作文件workers.properties的位置 JkWorkersFile /opt/httpd/conf/workers.properties
# Where to put jk logs
JkLogFile /opt/httpd/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"
# 将所有servlet 和jsp请求通过ajp13的协议送给Tomcat,让Tomcat来处理
JkMount /*/servlet/* worker1
JkMount /*.jsp worker1
JkMount /* worker1
httpd.conf
LoadModule jk_module modules/mod_jk.so
Include /opt/httpd/conf/mod_jk.conf
tomcat的server.xml
<engine name="Catalina" defaulthost="192.168.1.67" jvmroute="ajp13">
<host name="192.168.1.67" appbase="webapps" unpackwars="true" autodeploy="true" xmlvalidation="false" xmlnamespaceaware="false">
<context path="" docbase="/opt/tomcat/webapps/b2c" debug="0" reloadable="true" crosscontext="true">
</context>
</host>
</engine>