环境准备
yum -y install automake autoconf libtool make gcc gcc-c++ gcc-g77 readline-devel pcre-devel openssl-devel tcl perl libxml2-devel zlib-devel
yum install -y epel-release
yum install -y vim lrzsz wget telnet iotop iftop unzip git
安装Openresty
wget https://openresty.org/download/openresty-1.15.8.1.tar.gz
tar -zxvf openresty-1.15.8.1.tar.gz
mv openresty-1.15.8.1 /usr/local/openresty
cd /usr/local/openresty/bundle
wget https://www.openssl.org/source/openssl-1.1.1c.tar.gz
tar -zxvf openssl-1.1.1c.tar.gz
git clone git://github.com/alibaba/nginx-http-concat.git
wget https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/08a395c66e42.zip
unzip 08a395c66e42.zip
隐藏nginx版本号
vi nginx-1.15.8/src/core/nginx.h
#define NGINX_VERSION "8.8.8"
#define NGINX_VER "Hello/" NGINX_VERSION
编译
cd ..
./configure --user=nobody --group=nobody --prefix=/usr/local/openresty \
-j2 \
--with-http_stub_status_module \
--with-http_sub_module \
--with-http_gzip_static_module \
--with-http_realip_module \
--with-http_secure_link_module \
--with-http_ssl_module \
--with-http_v2_module \
--with-openssl=bundle/openssl-1.1.1c \
--with-ld-opt="-Wl,-rpath,$LUAJIT_LIB" \
--with-pcre \
--add-module=bundle/nginx-http-concat \
--add-module=bundle/nginx-goodies-nginx-sticky-module-ng-08a395c66e42
make -j2 && make install
ln -s /usr/local/openresty/nginx/sbin/nginx /sbin/nginx
完成