Apache 2.2.x

Apache HTTP Server versions 2.2.x provides load balancing tools through two Apache modules

The two modules are:

The mod_proxy_balancer module provides support of HTTP requests load balancing. The mod_headers module provides HTTP cookies management needed by the Cookie-based request processing. For Sessionless request processing, the mod_headers module is not required.

Sessionless requests

The following example shows how to configure Apache 2.2.x to do load balancing for sessionless requests. It assumes the architecture illustrated by Session-bound request processing.
<IfModule mod_proxy.c>
  ProxyPass / balancer://GASFarm
  <Proxy balancer://GASFarm>
    BalancerMember http://GAS1.corporate.com
    BalancerMember http://GAS2.corporate.com
  </Proxy>
</IfModule>

For example, the http://localhost/ws/r/echo URL will be rewritten to http://GAS1.corporate.com/ws/r/echo, assuming that the GAS1.corporate.com server has been chosen.

Session-bound requests

The following example shows how to configure Apache 2.2.x to do load balancing for session-bound requests. It assumes the architecture illustrated by Session-bound request processing. The example illustrates cookie-based request routing.
<IfModule mod_proxy.c>
  ProxyPass / balancer://GASFarm stickysession=GAS_AFFINITY
  <Proxy balancer://GASFarm>
    BalancerMember http://GAS1.corporate.com route=GAS1
    BalancerMember http://GAS2.corporate.com route=GAS2
  </Proxy>
</IfModule>

<IfModule mod_headers.c>
  Header add Set-Cookie "GAS_AFFINITY=balancer.%{BALANCER_WORKER_ROUTE}e;
  path=/; domain=.corporate.com" env=BALANCER_WORKER_ROUTE
</IfModule>

For example, the http://localhost/ua/r/gwc-demo URL will be rewritten to http://GAS1.corporate.com/ua/r/gwc-demo, assuming that the GAS1.corporate.com server has been chosen.