下载需要组件1 N9 M5 m+ o# f/ u
wget http://nginx.org/download/nginx-1.17.7.tar.gz0 W1 W; H7 G ]. c: \* q
tar xvzf nginx-1.17.7.tar.gz
7 {( x% N: q8 u- q3 L R5 s1 p
1 ], z; e* F* @: x- L5 rwget https://www.openssl.org/source/openssl-1.1.1d.tar.gz
1 h, ]: }3 f) h. b2 xtar xvzf openssl-1.1.1d.tar.gz
; J2 t+ H1 @4 U v
+ l2 [9 t+ z) z- H8 S _6 i5 Iwget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
, P& ]4 `( P# q, x' T4 Ytar xvzf pcre-8.43.tar.gz' \4 `3 }, r5 y. H
9 t. `: h E, m( m2 v
wget https://github.com/yaoweibin/ngx ... /archive/master.zip -O ngx_http_substitutions_filter.zip
3 n* L$ j" n) g- y9 G! i4 uunzip ngx_http_substitutions_filter.zip
3 C6 |6 X7 f R; @( _4 n
, |3 y% K' Y2 I, @) A3 Rcd nginx-1.17.7
" \6 M/ |* _" ?% o! Q* r% m7 d$ A; X* G
/ J W: [+ ]7 ^! D
配置文件
W8 j( w% B: B1 o, a2 Z. Q[Shell] 纯文本查看 复制代码 ./configure \
--user=www \
--group=www \
--prefix=/www/webserver/nginx-1.17.7 \
--sbin-path=/www/webserver/nginx-1.17.7/sbin/nginx \
--pid-path=/www/webserver/nginx-1.17.7/logs/nginx.pid \
--conf-path=/www/webserver/nginx-1.17.7/conf/nginx.conf \
--error-log-path=/www/webserver/nginx-1.17.7/logs/error.log \
--http-log-path=/www/webserver/nginx-1.17.7/logs/access.log \
--http-client-body-temp-path=/www/webserver/nginx-1.17.7/temp/client \
--http-proxy-temp-path=/www/webserver/nginx-1.17.7/temp/proxy \
--http-fastcgi-temp-path=/www/webserver/nginx-1.17.7/temp/fcgi \
--http-scgi-temp-path=/www/webserver/nginx-1.17.7/temp/scgi \
--http-uwsgi-temp-path=/www/webserver/nginx-1.17.7/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.43 \
--with-http_sub_module \
--with-http_geoip_module \
--add-module=/root/ngx_http_substitutions_filter_module-master \
--with-openssl=/root/openssl-1.1.1d ! R) K/ p" v" J
编译 make
( z! A7 z+ j/ K: t: G3 K安装 make install
2 h x0 a. S+ M4 i |