How to compile HAProxy for Debian/Ubuntu

If you want to use that latest and greatest feature in HAProxy, you’ll probably end up having it to build it yourself. If you’re adventurous enough to run a potentially unstable development version on your server, here’s how to compile the binary.

Get the latest dev version from here: haproxy.1wt.eu/#down

Set up the build environment:

apt-get install build-essential zlib1g-dev libpcre3-dev libssl-dev

Build the binary (assuming your Linux kernel version is >= 2.6.28):

make TARGET=linux2628 CPU=native USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1

This will include OpenSSL and zlib compression support.