Here are the configuration for Apache load balancer and reverse proxy
<VirtualHost *:90> #虚拟主机默认访问端口 ServerAdmin * ServerName astg.vj.com #服务器访问名 ServerAlias *.astg.vj.com #服务器访问别名 proxyrequests off# <IfModule mod_rewrite.c># RewriteEngine on# rewritecond %{http_host} ^astg.vj\ .com$ [nc]# rewriterule ^ (. *) $ http://astg.vj.com$1 [r=301,l]# </IfModule> #wallet-vhr <proxy balancer://wallet_vhr> balancermember http:// 192.168.10.18:60210/wallet-vhr loadfactor=1 route=s02 #loadfactor Weights route Server Authentication Identification balancermember http://192.168.10.17:60210/wallet-vhr loadfactor=1 route=s01 # </proxy> proxypass /wallet-vhr balancer://wallet_ vhr/ stickysession=jsessionid|jsessionid scolonpathdelim=on #将远程服务器映射到本地服务器的URL空间 Keep Sticky session # stickysession=jsessionid|jsessionid scolonpathdelim=on proxypassreverse /wallet-vhr balancer://wallet_vhr/ # It is generally used in conjunction with the PROXYPASS directive, which enables Apache to adjust the URL of the Location, content-location, uri header in an HTTP redirect reply. This avoids the use of Apache as a reverse proxy. HTTP redirection of the backend server caused the problem of bypassing the reverse proxy. #wallet-VHR
Choose Apache HTTP Server as the front-end load server, the backend select two tomcat for the cluster, this choice is configured in session Sticky (sticky session), this way to forward the same user's request to a specific Tomcat server, Avoid the replication of the session in the cluster, the disadvantage is that the user only with one of a server communication, if this server down, it is obsolete.
There is also a session mode is multiple server sharing mode, there is no more to say
This article is from the "Cubs blog" blog, make sure to keep this source http://9821177.blog.51cto.com/9811177/1788569
Questions about session sessions in Apache load balancing