This can be adapted to other operating systems, for the scope of this tutorial it will be designed for Redhat enterprise / Centos

Little info:

HAProxy is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for web sites crawling under very high loads while needing persistence or Layer7 processing. Supporting tens of thousands of connections is clearly realistic with todays hardware. Its mode of operation makes its integration into existing architectures very easy and riskless, while still offering the possibility not to expose fragile web servers to the Net
Okay lets install the software:

You will need a free ip, not binded to port 80, to begin this.

wget http://haproxy.1wt.eu/download/1.2/src/haproxy-1.2.17.tar.gz
tar -zxf haproxy-1.2.17.tar.gz
cd haproxy-1.2.17
make
cp haproxy /usr/sbin/haproxy
HAproxy is now installed. now we need to setup init files and configure this.

Lets grab the files:

wget http://layer1.rack911.com/haproxy/haproxy-standard.cfg -O /etc/haproxy.cfg
wget http://layer1.rack911.com/haproxy/haproxy.init -O /etc/init.d/haproxy
chmod +x /etc/init.d/haproxy
Time to configure this. There are a few changes you need to make in the configuration file, which is located here: /etc/haproxy.cfg

Open /etc/haproxy.cfg with your favorite editor and fine the line that says:

nbproc 4
Set it according to the number of processing cores you have. If you have just a celeron set it to 1. if you have a dual clovertown.. set it to 8. You get the picture.

Next, we need to set the listener:

listen http_proxy 4.0.0.0:80
if you want it to listen on ip 55.55.55.55 set it to this:

listen http_proxy 55.55.55.55:80
Next lets set the servers:

Lets say you have the following servers:

web1 66.66.66.66
web2 77.77.77.77
web3 88.88.88.88

You would configure the rest like this. Take the part that looks like this:

server server1 4.1.1.1:80 weight 1 maxconn 512 check
server server2 4.2.2.2:80 weight 1 maxconn 512 check
server server3 4.3.3.3:80 weight 1 maxconn 512 check
and make it look like this

server web1 66.66.66.66:80 weight 1 maxconn 512 check
server web2 77.77.77.77:80 weight 1 maxconn 512 check
server web3 88.88.88.88:80 weight 1 maxconn 512 check
Of course you can adjust the weight and maxconn according to your setup, I will however leave this to you as I don't want to get into it.

The final configuration would look something like this

global
maxconn 4096 # Total Max Connections. This is dependent on ulimit
daemon
nbproc 4 # Number of processing cores. Dual Dual-core Opteron is 4 cores for example.
defaults
mode http
clitimeout 60000
srvtimeout 30000
contimeout 4000
option httpclose # Disable Keepalive

listen http_proxy 55.55.55.55:80
balance roundrobin # Load Balancing algorithm
option httpchk
option forwardfor # This sets X-Forwarded-For
## Define your servers to balance
server web1 66.66.66.66:80 weight 1 maxconn 512 check
server web2 77.77.77.77:80 weight 1 maxconn 512 check
server web3 88.88.88.88:80 weight 1 maxconn 512 check
Finally lets start it, and add it to start up.

service haproxy start
chkconfig --add haproxy
Final Notes:

This is a basic round robin style load balancer. It will remove servers it cannot connect to, and add them back to the pool once they are back online.

There is loads of configuration options you can use. More information can be found here:

http://haproxy.1wt.eu/download/1.2/doc/haproxy-en.txt