Openresty二进制安装

这是一个用于在Linux系统中自动化安装OpenResty和Luajit的bash脚本。它首先检查用户权限,然后安装必要的编译工具,接着下载并解压OpenResty的tarball,配置编译选项,最后进行编译和安装。脚本还包含了权限设置和启动Nginx的部分。
摘要由CSDN通过智能技术生成

上干货:

#!/bin/bash

version="1.13.6.2"
name=openresty-$version
file=$name.tar.gz
prefix=/usr/local/openresty
TOOLS_DIR=/home/sunbox/soft
INSTALL_DIR=/usr/local
# Check if user is root
if [ $(id -u) != "0" ]; then
    echo "Error: You must be root to run this script, please use root to install"
    exit 1
fi

# Check network environmental
#NET_NUM=`ping -c 4 www.baidu.com |awk '/packet loss/{print $6}' |sed -e 's/%//'`
#if [ -z "$NET_NUM" ] || [ $NET_NUM -ge 10 ];then
#        echo "Please check your internet"
#        exit 1
#fi

#安装编译工具
yum -y install gcc gcc-c++ readline-devel pcre-devel openssl-devel tcl perl

[ ! -d $TOOLS_DIR ] && mkdir -pv $TOOLS_DIR

cd $TOOLS_DIR

#echo $file
if [ ! -f $file ]; then
      wget http://47.92.71.36:28801/$file     
      #wget https://openresty.org/download/$file
fi
#tar zxvf soft.tgz -C $INSTALL_DIR
tar zxvf $file -C $INSTALL_DIR
#cd $INSTALL_DIR/openresty

chown -R root:root $INSTALL_DIR/$name

cd $INSTALL_DIR/$name

./configure --prefix=/usr/local/openresty --with-luajit --with-http_stub_status_module --with-http_realip_module --with-http_v2_module --with-http_ssl_module --without-http_redis2_module --with-http_iconv_module
make -j2
make install

#./configure --prefix=/usr/local/openresty --with-luajit --without-http_redis2_module --with-http_iconv_module --with-http_ssl_module --with-http_realip_module  --with-http_v2_module
#gmake                                                                                                                                                                                                                                                                                                                                                                                                        
#gmake install

#cd $INSTALL_DIR/openresty/nginx/conf && cp nginx.conf.default nginx.conf

cd $INSTALL_DIR/openresty/nginx/sbin && ./nginx


                                                                                                                                                                                                                                                                                                                                                                     

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值