1、下载程序包

# wget http://www.haproxy.org/download/1.7/src/haproxy-1.7.5.tar.gz
# tar xvf haproxy-1.7.5.tar.gz -C /usr/local/src
# cd /usr/local/src/haproxy-1.7.5

2、编译安装,开启支持SSL

# yum groupinstall -y "Development Tools"
# yum install -y openssl openssl-devel
# uname -a
# make TARGET=linux31 USE_OPENSSL=1 ADDLIB=-lz
# make install PREFIX=/usr/local/haproxy

3、查看版本号和编译参数

-vv:Display HAProxy's version and all build options.

# /usr/local/haproxy/sbin/haproxy -vv
HA-Proxy version 1.7.5 2017/04/03
Copyright 2000-2017 Willy Tarreau <willy@haproxy.org> Build options :
TARGET = linux31
CPU = generic
CC = gcc
CFLAGS = -O2 -g -fno-strict-aliasing -Wdeclaration-after-statement
OPTIONS = USE_POLL=default USE_OPENSSL=1 Default settings :
maxconn = 2000, bufsize = 16384, maxrewrite = 1024, maxpollevents = 200 Encrypted password support via crypt(3): no
Built without compression support (neither USE_ZLIB nor USE_SLZ are set)
Compression algorithms supported : identity("identity")
Built with OpenSSL version : OpenSSL 1.0.1e-fips 11 Feb 2013
Running on OpenSSL version : OpenSSL 1.0.1e-fips 11 Feb 2013
OpenSSL library supports TLS extensions : yes
OpenSSL library supports SNI : yes
OpenSSL library supports prefer-server-ciphers : yes
Built without PCRE support (using libc's regex instead)
Built without Lua support
Built with transparent proxy support using: IP_TRANSPARENT IP_FREEBIND Available polling systems :
poll : pref=200, test result OK
select : pref=150, test result OK
Total: 2 (2 usable), will use poll. Available filters :
[COMP] compression
[TRACE] trace
[SPOE] spoe

4、创建用户和组

# groupadd -r -g 149 haproxy
# useradd -r -u 149 -g haproxy -s /sbin/nologin haproxy

5、提供配置文件(略)

# mkdir -pv /etc/haproxy

6、配置服务日志

# vim /etc/sysconfig/rsyslog
SYSLOGD_OPTIONS="-r -m 0 -c 2" # vim /etc/rsyslog.conf
# Save haproxy.log
local3.* /mnt/haproxy_logs/haproxy.log # vim /etc/haproxy/haproxy.cfg
global
log 127.0.0.1 local3 info # systemctl restart rsyslog

7、检查配置文件

-c:Only checks config file and exits with code 0 if no error was found, or exits with code 1 if a syntax error was found.

# /usr/local/haproxy/sbin/haproxy -c -f /etc/haproxy/haproxy.cfg
Configuration file is valid

8:启动haproxy

# /usr/local/haproxy/sbin/haproxy -f /etc/haproxy/haproxy.cfg

9、导出环境变量

# vim /etc/profile.d/haproxy.sh
export PATH=$PATH:/usr/local/haproxy/sbin
# source /etc/profile.d/haproxy.sh

最新文章

  1. 时时获得高德地图坐标 http://lbs.amap.com/console/show/picker
  2. TCP的拥塞控制
  3. iOS 7 与 Xamarin - MultiPeer Connectivity(转载)
  4. [转]git在eclipse中的配置
  5. HTML与CSS的关系
  6. Linux服务器上监控网络带宽的18个常用命令(转)
  7. [SQL]SqL给局部变量赋值有两种方法
  8. Python pexpect出现错误‘module have no attribute &quot;spawn&quot; 解决办法
  9. mongodb 操作语句与sql操作语句对比
  10. NDK编译FFMpeg[Linux]
  11. MyBatis(3.2.3) - Passing multiple input parameters
  12. Android 带着用户名的SharedPreferences
  13. 【技术贴】解决Mysql启动服务报错1067 进程意外终止
  14. Android 汉字转拼音之工具篇
  15. 跟我学ASP.NET MVC之三:完整的ASP.NET MVC程序-PartyInvites
  16. oracle修改审计功能
  17. Golang 笔记 4 defer、error、panic
  18. 洛谷 P3916 【图的遍历】反向加边+dfs
  19. MR的shuffle和Spark的shuffle之间的区别
  20. ExecutorService对象的shutdown()和shutdownNow()的区别

热门文章

  1. openstack系列文章(四)
  2. 学员管理系统(SQLAlchemy 实现)
  3. nodejs的Cannot find module &#39;body-parser&#39;
  4. TeamWork#3,Week5,Scrum Meeting 11.15
  5. JAVA第二次试验
  6. 软件项目的开发之svn的使用
  7. P4论文粗读笔记(一)
  8. 【搜索】POJ-3009 DFS+回溯
  9. mysql只修改年月日,时分秒不变
  10. python 创建目录