haproxy 源码安装

1.安装Development Tools group package
     查看develoment 工具 :yum grouplist -v  "development"  | grep tools
      yum install @development
2.安装ssl:    yum install openssl-devel
3.下载:
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
     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
     stats     hide-version
frontend

backend

2.ssl 认证:/etc/haproxy/cert.pem
tee:cat my-server.cer my-server.key | tee my-server.pem
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值