wget https://www.haproxy.org/download/3.0/src/haproxy-3.0.3.tar.gz;
tar -xf haproxy-3.0.3.tar.gz;
cd haproxy-3.0.3/
make -j 2 TARGET=linux-glibc PREFIX=/usr/local/haproxy
make install PREFIX=/usr/local/haproxy
mkdir /usr/local/haproxy/conf
mkdir /usr/local/haproxy/logs
cp examples/option-http_proxy.cfg /usr/local/haproxy/conf/haproxy.cfg
附加:编译报错
[root@abc haproxy-3.0.3]# make TARGET=linux2628 PREFIX=/usr/local/haproxy
Target 'linux2628' was removed from HAProxy 2.0 due to being irrelevant and
often wrong. Please use 'linux-glibc' instead or define your custom target
by checking available options using 'make help TARGET=<your-target>'.
make: *** [all] Error 1
解决方案
make TARGET=linux-glibc PREFIX=/usr/local/haproxy