As mentioned in a previous post we love HAproxy at Pixl8 its the handy penknife we use for high availability solutions.
1. TCP/IP balancing for SMTP relay,
2. High availability for MySQL
3. High availability for membership websites
4. Balancing load across our many varnishcache caching servers.
Below is a simple step by step how to assuming you have a Centos or Redhat Enterprise linux server, I haven't covered firewalling that should be handled seperatelty and I assume the readers comfort with Linux in this regard.
Once you're at the linux shell as root perform the following
type make
If no make is installed yum install make
- cd /tmp
- wget http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.19.tar.gz
- tar -zxf haproxy-1.4.19.tar.gz
- cd haproxy-1.4.19
- make "TARGET=linux26 USE_PCRE=1"
- mv haproxy /usr/sbin/
- wget http://www.pixl8.co.uk/downloads/haproxy.init.txt
- mv haproxy.init.txt /etc/init.d/haproxy
- chmod +x /etc/init.d/haproxy
- chkconfig --add haproxy
- chkconfig haproxy on
- wget http://www.pixl8.co.uk/downloads/haproxy.cfg.txt
- mv haproxy.cfg.txt /etc/haproxy.cfg
- service start haproxy
You will have a standard config that is proxying www.cnn.com, you can test this by adding www.cnn.com to your hosts file and pointing it at your HAProxy server IP of course need to edit the haproxy config file to reflect your server environment but the config piece is straightforward, make sure you restart haproxy on config changes using
service haproxy restart
There is a console set to listen on port 8080 the password details are in the sample config if you use it you should change them to your own values.


Copyright © 2011 Pixl8 Interactive, 3 Tun Yard, Peardon Street, London, SW8 3HT