haproxy安装及配置

(1)[root@server1 mnt]# yum install -y rpm-build
这里写图片描述
(2)这里写图片描述
(3)[root@server1 mnt]# rpmbuild -tb haproxy-1.7.3.tar.gz
这里写图片描述
(4)

[root@server1 mnt]# cd
[root@server1 ~]# cd rpmbuild/
[root@server1 rpmbuild]# ls
BUILD  BUILDROOT  RPMS  SOURCES  SPECS  SRPMS
[root@server1 rpmbuild]# cd RPMS/
[root@server1 RPMS]# ls
x86_64
[root@server1 RPMS]# cd x86_64/
[root@server1 x86_64]# ls
haproxy-1.7.3-1.x86_64.rpm
[root@server1 x86_64]# rpm -ivh haproxy-1.7.3-1.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:haproxy                ########################################### [100%]
[root@server1 x86_64]# ll /etc/init.d/haproxy 
-rwxr-xr-x 1 root root 2381 Apr 30 12:11 /etc/init.d/haproxy
[root@server1 x86_64]# cd
[root@server1 ~]# cd /etc/haproxy/

(5)

[root@server1 ~]# cd /mnt/
[root@server1 mnt]# ls
haproxy-1.7.3                              nginx-1.14.0.tar.gz
haproxy-1.7.3.tar.gz                       varnish-3.0.5-1.el6.x86_64.rpm
ldirectord-3.9.5-3.1.x86_64.rpm            varnish-libs-3.0.5-1.el6.x86_64.rpm
libnfnetlink-devel-1.0.0-1.el6.x86_64.rpm
[root@server1 mnt]# cd haproxy-1.7.3
[root@server1 haproxy-1.7.3]# ls
CHANGELOG     ebtree                   include      README   SUBVERS
contrib       examples                 LICENSE      ROADMAP  tests
CONTRIBUTING  haproxy                  MAINTAINERS  scripts  VERDATE
doc           haproxy-systemd-wrapper  Makefile     src      VERSION

(6)

[root@server1 haproxy-1.7.3]# cd examples/
[root@server1 examples]# ls
acl-content-sw.cfg     debugfind              seamless_reload.txt
auth.cfg               errorfiles             ssl.cfg
check                  haproxy.init           stats_haproxy.sh
check.conf             haproxy.spec           transparent_proxy.cfg
content-sw-sample.cfg  haproxy.vim            wurfl-example.cfg
debug2ansi             init.haproxy
debug2html             option-http_proxy.cfg
[root@server1 examples]# cp content-sw-sample.cfg /etc/haproxy/haproxy.cfg

(7)

[root@server1 examples]# ls
acl-content-sw.cfg     debugfind              seamless_reload.txt
auth.cfg               errorfiles             ssl.cfg
check                  haproxy.init           stats_haproxy.sh
check.conf             haproxy.spec           transparent_proxy.cfg
content-sw-sample.cfg  haproxy.vim            wurfl-example.cfg
debug2ansi             init.haproxy
debug2html             option-http_proxy.cfg
[root@server1 examples]# cd /etc/haproxy/
[root@server1 haproxy]# ls
haproxy.cfg

(8)[root@server1 haproxy]# vim haproxy.cfg
这里写图片描述
这里写图片描述
这里写图片描述
(9)[root@server1 haproxy]# /etc/init.d/haproxy start
这里写图片描述
(10)[root@server1 haproxy]# netstat -antlp
这里写图片描述
(11)d打开浏览器输入地址
http://172.25.26.1/admin/stats
这里写图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值