###Install HAProxy
yum install haproxy
###Update Config file for frontend and backend.
- No need to change 'global' and 'defaults' section.
- Sample Config : /etc/haproxy/haproxy.cfg
#---------------------------------------------------------------------
# main frontend which proxys to the backends
#---------------------------------------------------------------------
frontend www
bind *:80
default_backend app
#---------------------------------------------------------------------
# round robin balancing between the various backends
#---------------------------------------------------------------------
backend app
balance roundrobin
server app1 127.0.0.1:8080 check
###Enable logging
Follow instructions from this blog :
vi /etc/haproxy/haproxy.cfg
vi /etc/rsyslog.conf
echo "local2.* /var/log/haproxy.log" >> /etc/rsyslog.d/haproxy.conf
service rsyslog restart
service haproxy restart