下载需要组件& W. ^, O8 X* M- s0 t
wget http://nginx.org/download/nginx-1.17.7.tar.gz- n% `# k+ b, h( g8 {$ [
tar xvzf nginx-1.17.7.tar.gz' v9 e' n& Y8 L, N; u5 f. P% Y1 W( Y2 N
5 m X4 s8 g9 O* A& Dwget https://www.openssl.org/source/openssl-1.1.1d.tar.gz
& U8 F) D' \ ?tar xvzf openssl-1.1.1d.tar.gz
6 a7 J) m: ^$ k* s5 k3 f+ Y- i& N9 m& v6 l/ J# ~8 n8 N- v9 b3 Q
wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
% z0 K: `3 H+ A0 X" |5 M! otar xvzf pcre-8.43.tar.gz
0 M" z( N: E- p& Z7 ?0 ?
! h; u) V( U+ w W9 y: hwget https://github.com/yaoweibin/ngx ... /archive/master.zip -O ngx_http_substitutions_filter.zip
" u: F& }2 S% V# {8 q7 munzip ngx_http_substitutions_filter.zip
0 k4 v4 D# L) K( m+ X, W: w, b1 u- W- a% L' P3 {$ l5 c
cd nginx-1.17.7
1 \! u( |5 H2 M/ d3 S9 o0 f4 S4 I
2 o, r; i3 _: X% v+ B配置文件$ f" V) B( I1 `* }8 r$ k6 L J) K# i
[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 0 m! h2 K) W. |
编译 make4 O1 s0 M' S4 V& H- W& y
安装 make install
( L* A* q. f! b: P7 z |