wget http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.24.tar.gz
tar zxvf haproxy-1.4.24.tar.gz
cd haproxy-1.4.24
uname -a
make TARGET=linux26 PREFIX=/usr/local/haproxy
make install PREFIX=/usr/local/haproxy
vi /usr/local/haproxy/haproxy.cfg
global maxconn 51200 chroot /usr/local/haproxy uid 99 gid 99 daemon nbproc 2 pidfile /usr/local/haproxy/haproxy.pid defaults mode http option redispatch option abortonclose timeout connect 5000ms timeout client 10000ms timeout server 10000ms log 127.0.0.1 local0 err #[err warning info debug] balance roundrobin listen admin_stats bind 0.0.0.0:5888 option httplog stats refresh 30s stats uri /stats stats realm Haproxy Manager stats auth admin:admin listen test1 bind :6700 mode tcp server t1 192.168.1.101:8881 server t2 192.168.1.102:8881
原文:http://www.cnblogs.com/fr5s/p/3600974.html