mod_jk2确实很烂。
几天的mod_jk2的云山雾罩之后,apache2+tomcat5用mod_jk.so轻松搞定。
尽管apache.org也称不建议使用令人唾弃的mod_jk2.so了。但最新的tomcat中却给出的mod_jk2.so的默认配置文件:workers2.properties。大家不要被它迷惑。
推荐大家不用理会该文件,依旧采用mod_jk.so的workers.properties。如果不想从头手写配置文件,可以从老的tomcat中找到。或者在官方网站http://jakarta.apache.org/tomcat/connectors-doc-archive/jk2/jk/quickhowto.html可以找到。
httpd.conf加入以下几行:
# Load mod_jk module# Update this path to match your modules location
LoadModule jk_module libexec/mod_jk.so# Declare the module for <IfModule directive>
AddModule mod_jk.c# Where to find workers.properties# Update this path to match your conf directory location (put workers.properties next to httpd.conf)
JkWorkersFile conf/workers.properties# Where to put jk logs# Update this path to match your logs directory location (put mod_jk.log next to access_log)
JkLogFile /var/log/httpd/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 everything for context /examples to worker named worker1 (ajp13)
JkMount /examples/* worker1
workers.properties :
# Define 1 real worker using ajp13
worker.list=worker1# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13worker.worker1.host=localhostworker.worker1.port=8009worker.worker1.lbfactor=50worker.worker1.cachesize=10worker.worker1.cache_timeout=600worker.worker1.socket_keepalive=1worker.worker1.socket_timeout=300
Apache2与Tomcat5用mod_jk.so配置方案
博客指出mod_jk2很烂,虽最新tomcat给出mod_jk2.so默认配置文件workers2.properties,但不建议使用。推荐apache2+tomcat5采用mod_jk.so的workers.properties进行配置,还给出获取配置文件的途径,以及需在httpd.conf加入相关内容。
375

被折叠的 条评论
为什么被折叠?



