概述
1.安装Development Tools group package
查看develoment 工具 :yum grouplist -v
"development"
| grep tools
yum install @development
2.安装ssl:
yum install openssl-devel
3.下载:
wget http://haproxy.1wt.eu/download/1.5/src/devel/haproxy-1.5-dev18.tar.gz
4.解压:
tar xzf haproxy-1.5-dev18.tar.gz
5.编译:
cd haproxy-1.5-dev18
make TARGET=linux26 USE_OPENSSL=1 ADDLIB=-lz
6.
编译完之后确定关联到openssl
ldd haproxy | grep ssl
7.
安装编译好的
binary
make PREFIX=/usr/
local
/haproxy install
8.
设置配置文件haproxy.cfg配置文件
9.
检查配置文件是否ok
/usr/
local
/haproxy/sbin/haproxy -c -f /etc/haproxy.cfg
10.
启动haproxy:
/usr/
local
/haproxy/sbin/haproxy -f /etc/haproxy.cfg
备注:
1./etc/haproxy/haproxy.cfg
global
maxconn 65535
log 127.0.0.1 local3 info
chroot /usr/local/haproxy
uid 500
gid 500
daemon
nbproc 1
chroot /usr/local/haproxy
uid 500
gid 500
daemon
nbproc 1
pidfile /var/run/haproxy.pid
ulimit-n 65535
stats socket /var/tmp/stats
defaults
log global
mode http
maxconn 65535
option httplog
option httpclose
option dontlognull
option forwardfor
option redispatch
option abortonclose
stats refresh 30
retries 3
balance roundrobin
cookie SRV
timeout check 2000ms
timeout connect 5000ms
timeout server 50000ms
timeout client 50000ms
listen admin_status
bind 0.0.0.0:6553
mode http
log global
stats enable
stats refresh 5s
stats realm Haproxy Statistics
stats uri /admin?stats
stats auth admin:Admin123
log global
mode http
maxconn 65535
option httplog
option httpclose
option dontlognull
option forwardfor
option redispatch
option abortonclose
stats refresh 30
retries 3
balance roundrobin
cookie SRV
timeout check 2000ms
timeout connect 5000ms
timeout server 50000ms
timeout client 50000ms
listen admin_status
bind 0.0.0.0:6553
mode http
log global
stats enable
stats refresh 5s
stats realm Haproxy Statistics
stats uri /admin?stats
stats auth admin:Admin123
stats hide-version
frontend
backend
2.ssl 认证:/etc/haproxy/cert.pem
tee:cat my-server.cer my-server.key | tee my-server.pem
最后
以上就是文艺服饰为你收集整理的haproxy 源码安装的全部内容,希望文章能够帮你解决haproxy 源码安装所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复