This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Server Information | |
#LB ip 10.xxx.22.33 | |
#server-1 10.xxx.27.49 | |
#server-2 10.xxx.26.50 | |
global | |
log 127.0.0.1 local0 | |
log 127.0.0.1 local1 notice | |
maxconn 4096 | |
uid 99 | |
gid 99 | |
daemon | |
log-send-hostname | |
#debug | |
#quiet | |
defaults | |
log global | |
listen webfarm 10.xxx.22.33:80 | |
mode http | |
option httpchk GET /l7check.html HTTP/1.0 | |
option log-health-checks | |
option forwardfor | |
option httpclose | |
cookie SERVERID rewrite | |
cookie JSESSIONID prefix | |
balance roundrobin | |
stats enable | |
stats uri /admin | |
server xvadm01.ncli 10.xxx.27.49:80 cookie admin_portal_1 check inter 1000 rise 2 fall 5 | |
server xvadm02.ncli 10.xxx.26.50:80 cookie admin_portal_2 check inter 1000 rise 2 fall 5 | |
$ /etc/init.d/haproxy start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ wget http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.22.tar.gz | |
$ tar xvfz haproxy-1.4.24.tar.gz | |
$ cd harproxy-1.4.24 | |
$ make TARGET=linux26 ARCH=x86_64 | |
$ make install | |
$ cd examples | |
$ cp haproxy.init /etc/rc.d/init.d/haproxy | |
$ chmod 755 /etc/rc.d/init.d/haproxy | |
$ mkdir -p /etc/haproxy/ | |
$ cp /usr/local/src/haproxy-1.4.24/examples/haproxy.cfg /etc/haproxy/ | |
$ mkdir -p /etc/haproxy/errors/ | |
$ cp /usr/local/src/haproxy-1.4.24/examples/errorfiles/* /etc/haproxy/errors/ | |
$ cd /usr/sbin | |
$ ln -s /usr/local/sbin/haproxy haproxy | |
$ vi /etc/haproxy/haproxy.cfg |