下载需要组件# t& s- l3 ]( N; |. H) E8 ~1 j
wget http://nginx.org/download/nginx-1.17.7.tar.gz
! W+ X7 ~1 C- ?& z) Dtar xvzf nginx-1.17.7.tar.gz# A* h+ C+ m' o' R1 b) a% a
) H, R7 [, P. N0 C E
wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz9 u" V! O2 |1 X! e' B% [# c* ^
tar xvzf openssl-1.1.1d.tar.gz
6 q7 f! f; |4 S2 _
0 p" a9 ~1 P: Y7 r* X; a2 a" f$ _wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
7 l+ Z: \ y7 A: Q9 Z1 ^: ytar xvzf pcre-8.43.tar.gz3 A1 X7 A$ o H0 P; k2 p9 d4 j) L$ C
# {# b5 P i) e: ?wget https://github.com/yaoweibin/ngx ... /archive/master.zip -O ngx_http_substitutions_filter.zip/ Z& N; g" K' V( L( W' I2 Z* l: c
unzip ngx_http_substitutions_filter.zip
( Z" O b5 H3 B- c& A$ \: D) E2 b& a& T9 b) \% s
cd nginx-1.17.73 X8 Z3 W w/ W0 B U7 y9 h- L; b
1 ]5 Z( s7 ~" @: P0 q
- z* C0 N" h' n3 r- G
配置文件
% r6 t! j7 K. J3 |, h% |[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 ; C& R G$ u# m7 g- l G" ?, k
编译 make
& T- | C$ y2 W; D& Y5 }9 S" J1 q安装 make install6 X! G# S8 D0 P; Q$ L+ r9 g
|