1.3 EKP负载均衡配置文件设置
在Apache安装目录/conf目录下新建一个名为“httpd-ekp-balance.conf”的文件,在该文件中添加下面的内容。下面的内容是一个完整的两个EKP节点的集群示例设置,一般来说,只要替换其中的具体IP 及相关目录的路径即可完成配置。如果多于两个节点,则是在proxy 节处加入BalancerMember 并在后面的ProxyPassReverse 节加入新的节点即可。下表中的红色部分“m69”和“m115”需要与每个应用ekp\WEB-INF\classes\trswcmcluster.properties文件中的参数“cluster.session.balancerRoute”保持一致。
<VirtualHost *:80>
AddType text/Javascript .js
AddType text/css; .css
AddType text/html;charset=UTF-8 .html
ServerName my.ekp.com
ServerAdmin wu.guowei@trs.com.cn
<Proxy balancer://ekpcluster>
BalancerMember :8065 route=m69
BalancerMember :8060 route=m115
ProxySet stickysession=CSID
</Proxy>
RewriteEngine on
RewriteRule ^/ekp/(.*\.(jsp|do|jws|appletdo))$ balancer://ekpcluster/ekp/$1 [P,L]
RewriteRule ^/ekp/(.*;jsessionid.*)$ balancer://ekpcluster/ekp/$1 [P,L]
RewriteRule ^/ekp/(sd)$ balancer://ekpcluster/ekp/$1 [P,L]
RewriteRule ^/ekp/(TRSIdSSSOProxyServlet)$ balancer://ekpcluster/ekp/$1 [P,L]
#SoapService rule
RewriteRule ^/ekp/services/(.*) :8065/ekp/services/$1 [P,L]
ProxyPassReverse / :8065/
ProxyPassReverse /:8060/
#webpic
Alias /webpic "Z:/WCMData/webpic"
<Directory "Z:/WCMData/webpic">
Options -Indexes MultiViews FollowSymLinks Includes
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "D:/TRS/TRSEKPV65_Cluster_B1111/WCMData/webpic/WEB-INF">
Deny from all
</Directory>
#ekp
Alias /ekp "D:/TRS/TRSEKPV65_Cluster_B1111/Tomcat/webapps/ekp"
<Directory "D:/TRS/TRSEKPV65_Cluster_B1111/Tomcat/webapps/ekp">
Options -Indexes MultiViews FollowSymLinks Includes
DirectoryIndex index.html
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "D:/TRS/TRSEKPV65_Cluster_B1111/Tomcat/webapps/ekp/WEB-INF">
Deny from all
</Directory>
<Location /ekpcluster-manager>
SetHandler balancer-manager
#Deny from all
#设定可以访问管理器的主机
Allow from all
</Location>
</VirtualHost>