下载需要组件
! A8 j2 G/ B" Y1 P* ewget http://nginx.org/download/nginx-1.17.7.tar.gz
( i* l0 i, G9 U$ E7 t& etar xvzf nginx-1.17.7.tar.gz, B% q L7 k- ~% A" G* E
& n0 r6 z. I8 \& Kwget https://www.openssl.org/source/openssl-1.1.1d.tar.gz; G D" x, v: z. }1 s( d
tar xvzf openssl-1.1.1d.tar.gz4 y! L* C7 E* k# B( j; b! O1 [' g
5 ?5 h* `% r3 k2 j
wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz G8 A: U' g' |$ N0 R
tar xvzf pcre-8.43.tar.gz+ v: R4 N2 l2 ?
! ?% f4 H3 w& b8 j. Uwget https://github.com/yaoweibin/ngx ... /archive/master.zip -O ngx_http_substitutions_filter.zip
6 s7 q# k& S& [) K* Runzip ngx_http_substitutions_filter.zip) d8 e) @3 m/ _' D' c
* R5 r* Y" L, e: P3 Bcd nginx-1.17.7
" u$ r3 D M' z% B4 `/ p' b
I. R( X! P" z! f. ~8 N' r+ G3 Y0 P8 Y. C
配置文件
) s% z; g9 c* c; y[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 & x/ p* e) @; Y7 a- ]
编译 make, j# ?0 `0 o, e+ K/ n9 P
安装 make install- D D( N0 R' |% M+ T
|