#!/bin/bash yum -y install openssl readline-devel pcre-devel openssl-deve yum -y install lrzsz telnet* net-snmp-utils net-snmp gcc* man -y yum -y install libgcrypt-devel lrzsz perl-DBI perl-libwww-perl net-snmp-perl openssl-devel pcre-devel telnet nfs-utils rpcbind -y yum -y install libxml* mkdir /data/logs/nginx mkdir /data/package/ cd /data/package wget -N http://36.110.160.219/software/nginx/nginx-1.17.4.tar.gz #wget -N http://211.103.207.119:81/nginx-1.10.2.tar.gz wget -N http://36.110.160.219/software/nginx/pcre-8.33.tar.gz cd /usr/local/src wget -N http://36.110.160.219/software/nginx/nginx-rtmp-module-master.zip unzip nginx-rtmp-module-master.zip cd /data/package tar zxvf pcre-8.33.tar.gz cd /data/package/pcre-8.33 ./configure --prefix=/usr/local/pcre make && make install cd /data/package wget http://luajit.org/download/LuaJIT-2.0.5.tar.gz tar -zxvf LuaJIT-2.0.5.tar.gz cd LuaJIT-2.0.5 make install PREFIX=/usr/local/LuaJIT echo 'export LUAJIT_LIB=/usr/local/LuaJIT/lib' >> /etc/profile echo 'export LUAJIT_INC=/usr/local/LuaJIT/include/luajit-2.0' >> /etc/profile source /etc/profile cd /data/package/ wget https://github.com/simplresty/ngx_devel_kit/archive/v0.3.0.tar.gz tar zxvf v0.3.0.tar.gz cd /data/package/ wget https://github.com/openresty/lua-nginx-module/archive/v0.10.13.tar.gz tar zxvf v0.10.13.tar.gz cd /data/package tar zxvf nginx-1.17.4.tar.gz cd nginx-1.17.4 ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_realip_module --with-http_stub_status_module --with-http_flv_module --with-http_mp4_module --with-pcre=/data/package/pcre-8.33 --add-module=/usr/local/src/nginx-rtmp-module-master --with-http_sub_module --with-http_gzip_static_module --with-ld-opt=-Wl,-rpath,/usr/local/LuaJIT/lib --add-module=/data/package/ngx_devel_kit-0.3.0 --add-module=/data/package/lua-nginx-module-0.10.13 make -j8 && make install cd /etc/init.d && wget -N http://36.110.160.219/software/nginx/nginx && chmod +x nginx cd /usr/local/nginx/conf/ && mv nginx.conf nginx.conf.bak && wget -N http://36.110.160.219/software/nginx/nginx.conf service nginx start # /usr/local/nginx/sbin/nginx # ps aux|grep nginx ''' 安装并配置ngx_lua_waf cd /usr/local/nginx/conf/ git clone https://github.com/loveshell/ngx_lua_waf.git mv ngx_lua_waf/ waf mkdir /data/logs/nginx/hack -p chmod -R 755 /data/logs/nginx/hack ###vim waf/config.lua ''' ''' nginx.conf lua_need_request_body on; lua_package_path "/usr/local/nginx/conf/waf/?.lua"; lua_shared_dict limit 10m; init_by_lua_file /usr/local/nginx/conf/waf/init.lua; access_by_lua_file /usr/local/nginx/conf/waf/waf.lua; '''