(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