vol.1
将下载下来的mod_jk-apache-2.0.55.so重命名为mod_jk.so
放到apache的modules目录下。
vol.2
修改apache的conf/httpd.conf
在最后添加如下内容:
# Load mod_jk module
LoadModule jk_module modules/mod_jk.so
# Declare the module for <IfModule directive>
#AddModule mod_jk.c
# workers.properties的路径
JkWorkersFile "I:/Program Files/Apache Group/Apache2/conf/workers.properties"
# Where to put jk logs
JkLogFile "I:/Program Files/Apache Group/Apache2/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 /*/servlet/ to worker named worker1
JkMount /*/servlet/* worker1
# Send JSPs for context / to worker named worker1
JkMount /*.jsp worker1
#for webwork
JKMount /*.action worker1
#for freemarker
JKMount /*.ftl worker1
JkUnMount /*.gif worker1
JkUnMount /*.jpg worker1
vol.3
在apache的conf/下新建一个文件:workers.properties
内容如下:
workers.tomcat_home="I:\Program Files\Apache Software Foundation\Tomcat 5.5" #让mod_jk模块知道Tomcat
workers.java_home="D:\Sun\AppServer\jdk" #让mod_jk模块知道jdk的位置
#
worker.list=worker1 #list of workers, more workers can be sperated by ','.When starting up, the web server plugin will instantiate the workers whose name appears in the worker.list property, these are also the workers to whom you can map requests.
# entries for worker1
worker.worker1.type=ajp13 #类型
worker.worker1.host=localhost #本机,若上面的Apache主机不为localhost,作相应修改
worker.worker1.port=8009 #工作端口,若没占用则不用修改
worker.worker1.lbfactor=1 #代理数,不用修改