配置文件修改
1,Apache下http.conf增加虚拟主机】
Include conf/mod_jk.conf
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "E:\workspace_php\letsno1"
#BEGIN Redirect
RewriteEngine On
RewriteOptions Inherit
#END Redirect
JkMountFile conf/uriworkermap_letsno1.properties
<Directory "E:\workspace_php\letsno1\upload">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
2,conf下增加三个文件
1)mod_jk.conf内容如下:
# Load mod_jk module. Specify the filename
# of the mod_jk lib you have downloaded and
# installed in the previous section
LoadModule jk_module modules/mod_jk-1.2.28-httpd-2.2.3.so
# Where to find workers.properties
JkWorkersFile conf/workers.properties
# Watchdog thread interval in seconds
JkWatchdogInterval 120
# Where to put jk logs
JkLogFile 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 +DisableReuse
# JkRequestLogFormat set the request format
JkRequestLogFormat "%H %m %p %w %R %V %T"
HostnameLookups Off
2)workers.properties内容如下:
worker.list=loadbalancer,status
# Define the first node
worker.local1.port=8009
worker.local1.host=localhost
worker.local1.type=ajp13
# Now we define the load-balancing behaviour
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=local1
worker.loadbalancer.sticky_session=true
worker.loadbalancer.sticky_session_force=false