admin 发表于 2017-10-19 13:50:40

nginx-1.13.6+replace-filter-nginx-module+modsecurity编译安装手迹

准备文件:
wget https://www.openssl.org/source/openssl-1.1.0f.tar.gz
tar xvzf openssl-1.1.0f.tar.gz
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
tar xvzf pcre-8.41.tar.gz

wget http://nginx.org/download/nginx-1.13.6.tar.gz
tart xvzf nginx-1.13.6.tar.gz

wget https://github.com/openresty/sregex/archive/master.zip
mv master.zip replace-filter-nginx-module-master.zip
unzip replace-filter-nginx-module-master.zip

安装sregex

wget https://github.com/openresty/sregex/archive/master.zip
mv master.zip sregex.zip
unzip sregex.zip
cd sregex
make && make installln -s /usr/lib/libsregex.so.0/usr/local/lib/libsregex.so.0.0.1 #按实际情况调整
ldconfig

安装modsecurity
『依赖的包:pcre httpd-devel libxml2 apr 视情况安装。yum install httpd-devel apr apr-util-devel apr-develpcre pcre-devellibxml2 libxml2-devel)』
git clone https://github.com/SpiderLabs/ModSecurity.git mod_security
cd mod_security
./autogen.sh
./configure --enable-standalone-module
make


安装nginx
cd nginx-1.13.6

./configure \
--user=www \
--group=www \
--prefix=/www/webserver/nginx-1.13.6 \
--sbin-path=/www/webserver/nginx-1.13.6/sbin/nginx \
--pid-path=/www/webserver/nginx-1.13.6/logs/nginx.pid \
--conf-path=/www/webserver/nginx-1.13.6/conf/nginx.conf \
--error-log-path=/www/webserver/nginx-1.13.6/logs/error.log \
--http-log-path=/www/webserver/nginx-1.13.6/logs/access.log \
--http-client-body-temp-path=/www/webserver/nginx-1.13.6/temp/client \
--http-proxy-temp-path=/www/webserver/nginx-1.13.6/temp/proxy \
--http-fastcgi-temp-path=/www/webserver/nginx-1.13.6/temp/fcgi \
--http-scgi-temp-path=/www/webserver/nginx-1.13.6/temp/scgi \
--http-uwsgi-temp-path=/www/webserver/nginx-1.13.6/temp/uwsgi \
--with-http_flv_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_gzip_static_module \
--with-pcre=/root/pcre-8.41 \
--with-http_sub_module \
--add-module=/root/replace-filter-nginx-module-master \
--add-module=/root/mod_security/nginx/modsecurity \
--with-openssl=/root/openssl-1.1.0f
make
make install

注:--with-ipv6 已经被移除默认支持ipv6,   --with-http_spdy 已经被移除合并到--with-http_v2_module









页: [1]
查看完整版本: nginx-1.13.6+replace-filter-nginx-module+modsecurity编译安装手迹