Sunday, October 24, 2010

Setting up the Apache Load Balancer

Install the Apache 2.2

Edit the conf\httpd.conf as mention below.


#Change the Listen port as you need
Listen 8990

#Load the following modules (Uncomment)
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule status_module modules/mod_status.so

#Add following to Set the Env variables (Not required)
SetEnv proxy-sendcl 1
SetEnv proxy-nokeepalive 1 #keep the connections live
SetEnv downgrade-1.0 1 #downgrade the HTTP version to 1.0

#define the proxy pass for load balancer of the cluster
ProxyPass / balancer://mycluster/
ProxyPassReverse / balancer://mycluster/
ProxyPass /ccx balancer://mycluster/
ProxyPassReverse /ccx balancer://mycluster/

#define the cluster members of the balancer

Reference : http://httpd.apache.org/docs/2.1/mod/mod_proxy.html
http://httpd.apache.org/docs/2.1/mod/mod_proxy_balancer.html

No comments:

Post a Comment