Skip to content

Instantly share code, notes, and snippets.

@kalendae
Created March 19, 2009 20:23
Show Gist options
  • Select an option

  • Save kalendae/82029 to your computer and use it in GitHub Desktop.

Select an option

Save kalendae/82029 to your computer and use it in GitHub Desktop.
haproxy setup
1) setup epel repo in yum
a) copy epel.repo file to /etc/yum.repos.d
b) rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
2) yum install haproxy
3) setup /etc/haproxy.cfg
4) setup logging
a) create /var/log/haproxy dir
b) edit /etc/syslog.conf add these lines
local0.* -/var/log/haproxy/haproxy.log
local1.* -/var/log/haproxy/haproxy_1.log
c) edit /etc/sysconfig/syslog add -r to SYSLOGD_OPTIONS
SYSLOGD_OPTIONS="-m 0 -r"
5) restart syslog
starter config:
# this config needs haproxy-1.1.28 or haproxy-1.2.1
global
log 127.0.0.1 local0 info
maxconn 4096
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
#debug
#quiet
defaults
log global
mode http
option httpclose
option httplog
option dontlognull
option forwardfor
retries 3
redispatch
maxconn 2000
contimeout 5000
clitimeout 50000
srvtimeout 50000
listen webfarm pr3.adrocket.com:80
mode http
balance roundrobin
server web1 pr3.adrocket.com:8080 weight 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment