日期:2014-05-16 浏览次数:20877 次
#加载mod_jk Module LoadModule jk_module modules\mod_jk-1.2.31-httpd-2.2.3.so #指定 workers.properties文件路径 JkWorkersFile conf/workers.properties # Where to put jk logs JkLogFile logs/mod_jk.log # Set the jk log level [debug/error/info] JkLogLevel info # 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" JkMount /* controller # 转发某个目录下的(此例为:/example)所有文件给tomcat: #JkMount /example/* tomcat1 #指定哪些请求交给tomcat处理,"controller"为在workers.propertise里指定的负载分配控制 #器,/* 表示所有请求均由tomcat处理 #JkMount /* controller
#controller,tomcat1,tomcat2 #server 列表 worker.list = controller #server 列表 #========tomcat1======== worker.tomcat1.port=11009 #ajp13 端口号,在tomcat下server.xml配置,默认8009 worker.tomcat1.host=localhost #tomcat的主机地址,如不为本机,请填写ip地址 worker.tomcat1.type=ajp13 worker.tomcat1.lbfactor = 1 #server的加权比重,值越高,分得的请求越多 #========tomcat2======== worker.tomcat2.port=12009 #ajp13 端口号,在tomcat下server.xml配置,默认8009 worker.tomcat2.host=localhost #tomcat的主机地址,如不为本机,请填写ip地址 worker.tomcat2.type=ajp13 worker.tomcat2.lbfactor = 1 #server的加权比重,值越高,分得的请求越多 #========controller,负载均衡控制器======== worker.controller.type=lb #tomcat1,tomcat2 worker.controller.balanced_workers=tomcat1,tomcat2 #指定分担请求的tomcat worker.controller.sticky_session=false #worker.controller.sticky_session=true 这两句话等同,此处表示是否session复制 worker.controller.sticky_session_force=1