高性能代理服务器Haproxy
cd /usr/local
wget https://fossies.org/linux/misc/haproxy-1.7.0.tar.gz
tar -xvf haproxy-1.7.0.tar.gz
cd haproxy-1.7.0
make TARGET=linux2628 PREFIX=/usr/local/haproxy
make install PREFIX=/usr/local/haproxy
cd /usr/local/haproxy
vim haproxy.cfg
http代理配置:
1 | #####全局配置###### |
vim /etc/profile1
2
3#haproxy
HAPROXY_HOME=/usr/local/haproxy
export PATH=#HAPROXY_HOME/sbin:$PATH
启动haproxy: /usr/local/haproxy/sbin/haproxy -f /usr/local/haproxy/haproxy.cfg
查看haproxy进程1
2
3root@bls:/usr/local/haproxy# ps -ef | grep haproxy
root 4506 1855 0 17:23 ? 00:00:00 ./sbin/haproxy -f /usr/local/haproxy/haproxy.cfg
root 4923 14152 0 17:33 pts/19 00:00:00 grep --color=auto haproxy
tcp代理配置:
1 | #####全局配置###### |