无法在centos 6.5上安装haproxy 1.5

时间:2014-08-26 17:11:23

标签: haproxy centos6.5

我正在尝试在我的centos 6.5服务器上安装haproxy。我正在使用命令

 yum install haproxy

此命令安装版本1.4.x.我还查看了以下链接,但无法使其正常工作

http://virtuallyhyper.com/2013/05/configure-haproxy-to-load-balance-sites-with-ssl/

http://blog.haproxy.com/2012/09/10/how-to-get-ssl-with-haproxy-getting-rid-of-stunnel-stud-nginx-or-pound/

https://github.com/bluerail/haproxy-centos

我该如何安装?

2 个答案:

答案 0 :(得分:1)

您可以按如下方式构建RPM:

mkdir -p rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
sudo yum -y install pcre-devel openssl-devel
cd rpmbuild/SOURCES
curl -L -O http://www.haproxy.org/download/1.5/src/haproxy-1.5.3.tar.gz
tar zxf haproxy-1.5.3.tar.gz
cd ..

cp -p SOURCES/haproxy-1.5.3/examples/haproxy.spec SPECS/haproxy153.spec
sed -i 's/Release: .*/Release:  %{?_release:%{_release}}%{!?_release:1}/' SPECS/haproxy153.spec
sed -i 's/USE_PCRE=1 /USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 /' SPECS/haproxy153.spec
rpmbuild --define "_topdir `pwd`" --define "_release 2" -bb SPECS/haproxy153.spec

(我使用本地目录并设置版本号,否则它与http://qiita.com/uemura/items/e822c1ed505b9fe0208f相同)

安装

scp RPMS/x86_64/haproxy-1.5.3-2.x86_64.rpm root@somewhere:~/
somewhere# yum localinstall ~/haproxy-1.5.3-2.x86_64.rpm

答案 1 :(得分:0)

您可以使用以下某个tar包从源代码安装:

http://www.haproxy.org/download/1.5/src/

您可能需要安装以下软件包以从源代码编译:

yum openssl-devel pcre-devel make gcc

这里还有script,我认为它可以适用于你的环境