# HTTP load balancing.

**URL:** <https://community.unix.com/t/http-load-balancing/292191>\
**Category:** Linux\
**Created:** [July 25, 2011, 11:42am UTC](https://community.unix.com/t/http-load-balancing/292191 "2011-07-25T11:42:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisfb](https://community.unix.com/letter_avatar/chrisfb/32/6_449c533f586939b6e5f246632a46421f.png) [@chrisfb](https://community.unix.com/u/chrisfb)\
**Post date:** [July 25, 2011, 11:42am UTC](https://community.unix.com/t/http-load-balancing/292191/1 "2011-07-25T11:42:02Z")

</div>

Hi,

We have 2 pools of servers. Lets call them A and B and they would contain 2 servers each. Pool A will be hosting [www.example.com/app/v1](http://www.example.com/app/v1) and pool B will be hosting [www.example.com/app/v2](http://www.example.com/app/v2). Clients will be requesting right url (/v1 or /v2) but will be hitting just one IP.

I'd like to:  
1) send traffic to the right pool.  
2) load balance it across servers in that pool

So what are my options? Any examples please? Is it possible to do that with just one box acting as a proxy/load balancer?

Many thanks  
Chris

---

<div class="post-metadata">

**Author:** ![mark54g](https://community.unix.com/letter_avatar/mark54g/32/6_449c533f586939b6e5f246632a46421f.png) [@mark54g](https://community.unix.com/u/mark54g)\
**Post date:** [July 26, 2011, 7:31pm UTC](https://community.unix.com/t/http-load-balancing/292191/2 "2011-07-26T19:31:17Z")

</div>

If you are just serving out different applications or static data, then you don't really need 2 pools of servers, just a load balancer. You can then set them up as virtual servers.

The load balancer IP is the only one you would expose and it would tag a session to whichever server it decides to go on based on whatever load balancing algorithm it uses.

take a look at this:

> **[The Linux Virtual Server Project - Linux Server Cluster for Load Balancing](http://www.linuxvirtualserver.org/)**
>
> The Linux Virtual Server web site

---

<div class="post-metadata">

**Author:** ![chrisfb](https://community.unix.com/letter_avatar/chrisfb/32/6_449c533f586939b6e5f246632a46421f.png) [@chrisfb](https://community.unix.com/u/chrisfb)\
**Post date:** [July 27, 2011, 4:26am UTC](https://community.unix.com/t/http-load-balancing/292191/3 "2011-07-27T04:26:54Z")

</div>

Hi Mark54g,

Thank you for your time. I've managed to do what I wanted yesterday but didn't have time to post back. Unfortunately I needed 2 pools - some servers are migrated to VM, some need to stay physical for time being. 2 different apps as well (luckily stateless so no need for stickiness). End of the day, very easy config.

For future reference, simplified config from apache:

```nohighlight
<Proxy *>
    Order deny,allow
    Deny from all
    Allow from 10.100.0.0
</Proxy>

<Proxy balancer://app1>
BalancerMember http://10.10.10.1:80 ping=1
BalancerMember http://10.10.10.2:80 ping=1
</Proxy>

<Proxy balancer://app2>
BalancerMember http://10.10.10.3:80 ping=1
BalancerMember http://10.10.10.4:80 ping=1
</Proxy>

ProxyPass /v1 balancer://app1
ProxyPass /v2 balancer://app2

```

Hope that helps!  
Chris

---

<div class="post-metadata">

**Author:** ![mark54g](https://community.unix.com/letter_avatar/mark54g/32/6_449c533f586939b6e5f246632a46421f.png) [@mark54g](https://community.unix.com/u/mark54g)\
**Post date:** [July 27, 2011, 9:14am UTC](https://community.unix.com/t/http-load-balancing/292191/4 "2011-07-27T09:14:11Z")

</div>

You still really don't need 2 pools, but if it works, sure, use it.

Don't forget proxypassreverse

[http://knowledge.oscc.org.my/solution-areas/infrastructure/web-server/apache-proxypass-and-proxypassreverse-directives](http://knowledge.oscc.org.my/solution-areas/infrastructure/web-server/apache-proxypass-and-proxypassreverse-directives)
