下载需要组件
: F" K3 V9 T- c3 L3 uwget http://nginx.org/download/nginx-1.17.7.tar.gz- s, |( [# W' f9 r- r) D2 O
tar xvzf nginx-1.17.7.tar.gz
/ E& x" a) v: ], B; n% @3 O. H
. F% c; L2 {6 ~4 H+ Lwget https://www.openssl.org/source/openssl-1.1.1d.tar.gz) a- H$ W" c) I7 z
tar xvzf openssl-1.1.1d.tar.gz3 n5 o/ l1 k9 L) y; _$ L A+ v
! _0 j; U2 ^9 p! _# Nwget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz \! J3 A% z9 I
tar xvzf pcre-8.43.tar.gz
+ ]& N+ N, m p, |3 ^2 N. W2 e: I' @+ Z) B* M6 Z) _8 P
wget https://github.com/yaoweibin/ngx ... /archive/master.zip -O ngx_http_substitutions_filter.zip) ]. \+ w: X1 U. N) U b8 k/ C
unzip ngx_http_substitutions_filter.zip2 ~& u: `' G* Z' b2 \- k
+ |3 r2 a- r! a9 M0 j
cd nginx-1.17.76 l% U5 n, b* p. {7 G: p
5 v- {1 \' @: T' z! X
/ s& X) s7 J( \, `! j1 K9 y8 m( H配置文件
3 E+ C) J9 t/ L2 {[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
" e4 G5 n, S+ H" I* b0 k; f编译 make0 b4 N; s" w- j7 e, ~+ l$ v; i
安装 make install
) t; y3 J) M, n+ I% y |