首先下载nginx依赖的第三方库文件:
pcre: http://pcre.org/
zlib:http://zlib.net/
openssl:https://www.openssl.org/
下载完并解压缩到指定的目录,如/app/app/soft。
进入nginx源码目录,执行以下命令:
./configure –prefix=/app/app/nginx –with-http_realip_module –with-http_sub_module –with-http_flv_module –with-http_dav_module –with-http_gzip_static_module –with-http_stub_status_module –with-http_addition_module –with-pcre=/app/app/soft/pcre-8.40 -with-openssl=/app/app/soft/openssl-1.1.0e –with-http_ssl_module –with-zlib=/app/app/soft/zlib-1.2.11
以上命令分别指定了基路径–prefix=/app/app/nginx、以及安装的模块、指定了依赖的pcre、zlib、openssl文件位置。
执行make,以下为打印信息:
Configuration summary
+ using PCRE library: /app/app/soft/pcre-8.40
+ using OpenSSL library: /a