haproxy编译安装

本文档详细介绍了在CentOS系统中如何编译安装haproxy并添加lua库支持的过程,包括安装依赖、下载源码、编译参数设置、配置haproxy服务脚本以及主配置文件等步骤。但在安装完成后,服务无法启动且`reboot`命令失效,寻求解决方案。
摘要由CSDN通过智能技术生成

#cnetos系统编译安装haproxy
#需要依赖lua库,官网:http://www.lua.org
#harpoxy 官网下载:http://www.haproxy.org/download/

DIR=pwd
file_lua=“lua-5.4.3”
file_haproxy=“haproxy-2.2.11”
suffix=".tar.gz"
lua_install_dir=/usr/local/src
haproxy_install_dir=/apps/haproxy
tar_dir=/usr/local/src
local_ip=ifconfig | grep 'netmask' | head -n1 |awk '{print $2}' #主机的ip地址
port=9999 #定义状态页监听端口

check(){
echo “正在安装环境包,请勿退出!”
yum install -y make vim wget libtermcap-devel ncurses-devel libevent-devel readline-devel gcc gcc-c++ glibc glibc-devel pcre pcre-devel openssl openssl-devel net-tools iotop zip unzip zlib-devel lrzsz tree lsof tcpdump systemd-devel
[ -f D I R / {DIR}/ DIR/{file_lua}KaTeX parse error: Expected '}', got 'EOF' at end of input: …} ] || { echo "{lua_file}${suffix} is not find" ; exit 1; }
[ -f D I R / {DIR}/ DIR/{file_haproxy}KaTeX parse error: Expected '}', got 'EOF' at end of input: …} ] || { echo "{lua_haproxy}${suffix} is not find" ; exit 1; }
if ! id haproxy &>/dev/null ;then
useradd -s /sbin/nologin -r haproxy
else
echo “haproxy用户已存在,略过用户创建!”
fi
[ -d ${lua_install_dir} ] || mkdir -p ${lua_install_dir}
}
install_lua(){
tar xf D I R / {DIR}/ DIR/{file_lua}${suffix} -C ${lua_install_dir}
cd l u a i n s t a l l d i r / {lua_install_dir}/ luainstalldir/{file_lua}
make all test
if [ $? -eq 0 ];then
l u a

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值