下载需要组件
+ Z5 w8 }& n& P' \! _ X; awget http://nginx.org/download/nginx-1.17.7.tar.gz q1 O. L8 M. I0 M% `8 l
tar xvzf nginx-1.17.7.tar.gz
6 N% g7 }$ n$ x9 @
. ]2 Q% L1 D) w' d4 U6 V! Iwget https://www.openssl.org/source/openssl-1.1.1d.tar.gz# }3 V7 y6 R6 ^
tar xvzf openssl-1.1.1d.tar.gz* J6 V& W6 H' |# t) `" p$ ~
2 W0 b2 L* F, z1 v/ T% Z* cwget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz: I8 {# t' b0 ?5 f _
tar xvzf pcre-8.43.tar.gz5 i6 e; e% R- j- h0 \" x
, K2 B" W: ^$ |5 a
wget https://github.com/yaoweibin/ngx ... /archive/master.zip -O ngx_http_substitutions_filter.zip8 a! {4 a" L2 A! e! m, R% J" s
unzip ngx_http_substitutions_filter.zip
$ }8 B7 L3 A( w. J% e) w; u; t' D! H/ V6 \) x% H
cd nginx-1.17.7& q: a* j, W4 j1 j" w
( d- ]: P) W' g* \) e" M1 X. y! `! N% @0 g7 j3 M3 ?6 Y# q2 X
配置文件
! u& I& x2 v6 o[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 & i' F" x, _9 D; Y: V
编译 make
( r7 t7 D* I) E安装 make install4 E7 R3 K" Z# E# J& B% y
|