附录
一个完整的配置例子: #mod jk for tomcat-apache integration LoadModule jk_module modules/mod_jk.so JkWorkersFile conf/workers.properties
# Where to put jk logs JkLogFile logs/mod_jk。log # Set the jk log level [debug/error/info] JkLogLevel debug # Select the log format JkLogStampFormat "[%Y-%m-%d %H:%M:%S] "
# JkOptions indicate to send SSL KEY SIZE, JkOptions +ForwardKeySize +ForwardURICompat +ForwardURICompatUnparsed -ForwardDirectories # JkRequestLogFormat set the request format JkRequestLogFormat "%w %V %T" # Static files in the examples webapp are served by apache Alias / /www/tomcat4。1/webapps/ROOT/ # The following line prohibits users from directly access WEB-INF AllowOverride None
deny from all AllowOverride FileInfo AuthConfig Limit Indexes Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec #JkAutoAlias /www/tomcat4.1/webapps/ROOT JkMount /BaseServlet worker1 JkMount /Servlet/* worker1 JkMount /ProductUploadServlet worker1 JkMount /upload worker1 JkMount /test worker1 JkMount /*.jsp worker1 JkMount /*.do worker1
此外,jk还需要一个workers.properties文件配置jk本身的参数.如过不需要培植负载平衡
可以使用以下配置
# Define 1 real worker using ajp13 worker.list=worker1 # Set properties for worker1 (ajp13) worker.worker1.type=ajp13 worker.worker1.host=127.0.0.1 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 要注意的是JkMount所引用的worker的名称必须是在work.list定义过的。
|