下载需要组件- N: U9 [+ W! b; K3 }# X- r$ {6 n: ?
wget http://nginx.org/download/nginx-1.17.7.tar.gz
# O% i, `3 ~2 c9 }0 W$ m2 U3 Ftar xvzf nginx-1.17.7.tar.gz
# C& n& I, F" ?: X: P$ }' Z) Q0 b2 [- B( F; m$ J1 G2 r8 E% d
wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz
: c. ?: p4 D0 {. ]3 |tar xvzf openssl-1.1.1d.tar.gz! {" y5 ?* I+ |4 [. @
# N3 H& V/ {9 P$ ywget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
9 ~/ a* O: @, ?& @, q9 l2 etar xvzf pcre-8.43.tar.gz
1 V! W, v* `$ M' }- J) O7 }& s \# t. b. b8 P2 X
wget https://github.com/yaoweibin/ngx ... /archive/master.zip -O ngx_http_substitutions_filter.zip
1 _4 |' a% r+ `, t: lunzip ngx_http_substitutions_filter.zip
+ a. `: J8 N$ D5 B
+ l( n0 ]0 Y. n, V9 `# Dcd nginx-1.17.7: \, R3 M- g @2 c( {( {' g }
/ ~' X* q( @) J+ ^ n4 u0 O4 L- [/ l' ?
配置文件
6 d3 K" n4 ~0 w, p' S; f* c r[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 / i2 P" r2 `+ X, v2 ]" _3 `
编译 make
2 \9 S& c7 g& U' p安装 make install
4 G0 L( u+ B9 R: t |