5、配置。
在/usr/local/apache2/conf/下面建立两个配置文件mod_jk.conf和workers.properties。
# vi mod_jk.conf
添加以下内容:
代码:
# 指出mod_jk模块工作所需要的工作文件workers.properties的位置 #for webwork JkMount /*.action
JkWorkersFile /usr/local/apache2/conf/workers.properties
# Where to put jk logs
JkLogFile /usr/local/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"
# 将所有servlet 和jsp请求通过ajp13的协议送给Tomcat,让Tomcat来处理
JkMount /servlet/* worker1
JkMount /*.jsp worker1
注意:最后的几个语句,*.action为配置解析webwork2,这点搞了我两天.同样的,如要用Tomcat解析其它类型,也在这里添加.
# vi workers.properties添加以下内容:
代码:
# Defining a worker named worker1 and of type ajp13 #下面这句好象不支持了,还是换了格式?
worker.list=worker1
# Set properties for worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=50
#worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300