openresty防cc
同步系统时间(非必须)
yum install ntpdate
ntpdate cn.pool.ntp.org
安装工具
yum install wget unzip git -y
准备编译环境
yum -y install gcc gcc-c++
下载并解压源码包
wget https://openresty.org/download/openresty-1.13.6.2.tar.gz
tar xf openresty-1.13.6.2.tar.gz
pcre
wget https://ftp.pcre.org/pub/pcre/pcre-8.32.tar.gz
tar zxvf pcre-8.32.tar.gz
zlib
wget http://www.zlib.net/fossils/zlib-1.2.7.3.tar.gz
tar zxvf zlib-1.2.7.3.tar.gz
openssl
wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2k.tar.gz
tar zxvf openssl-1.0.2k.tar.gz
upstream_check扩展
git clone https://github.com/yaoweibin/nginx_upstream_check_module.git
解决依赖
yum -y install perl libxml2 libxml2-devel libxslt libxslt-devel gd gd-devel perl-ExtUtils-Embed geoip geoip-devel
修改服务器版本号
默认为OpenResty 1.13.6.1 这里修改为OpenResty
vim bundle/nginx-1.13.6/src/core/nginx.h
修改:#define NGINX_VER “openresty”
编译安装openrestry
cd /srv/openresty-1.13.6.2
./configure \
--prefix=/usr/local/nginx \
--with-http_iconv_module \
--with-luajit \
--sbin-path=/usr/local/nginx/sbin/nginx \
--modules-path=/usr/local/nginx/modules \
--conf-path=/usr/local/nginx/conf/nginx.conf