I am trying to launch HA Proxy 1.4.24 on an ubuntu 13 VM via sudo. My haproxy.cfg file is copied below. However, when I use sudo service haproxy start or try sudo /etc/init.d/haproxy start, the process not start up. Any ideas on troubleshooting this would be helpful. The config file appears to pass the configuration test (sudo haproxy -f haproxy.cfg -c results in "Configuration file is valid").
Also, Enabled flag in the haproxy file in /etc/init.d is set to 1.
Port 80 does not appear to be bound by any other service.
Update: I had set the enabled flag to 1 in the /etc/init.d/haproxy file as opposed to in the /etc/default/haproxy file - fixing this change allowed me to run haproxy normally.
global
maxconn 25000 # Total Max Connections. This is dependent on ulimit
daemon
nbproc 4 # Number of processing cores. Dual Dual-core Opteron is 4 cores for example.
defaults
mode http
clitimeout 60000
srvtimeout 30000
contimeout 4000
timeout http-request 5s # added to tackle slow http requests
option abortonclose
option forwardfor
listen http_proxy *:80
#bind *:80
balance roundrobin # Load Balancing algorithm
option httpchk
option forwardfor # This sets X-Forwarded-For
default_backend bk_web
# Dynamic part of the application
backend bk_web
## Define your servers to balance
balance roundrobin ## change to URL hashing
cookie MYSRV insert indirect nocache ## check this NOTE TO SELF
server server1 0.0.0.0:81 weight 1 maxconn 512 check
server server2 0.0.0.0:82 weight 1 maxconn 512 check
Your should use
and this will print debug infomation.And where you got wrong.