- 1.安装方式
- 2.现在需求
- 3.原因
- 4.解决方式
- 5.实操
- 5.1查看已安装信息
- 5.2重新编译
1.安装方式
多种多样,可以是离线安装、yum安装或者其他方式
2.现在需求
在使用新的模块时,如ssl,提示缺少该模块
3.原因
在安装是,configure未带上该模块
4.解决方式
手动再将缺少的模块编译进去,然后替换掉启动程序(nginx)
5.实操
5.1查看已安装信息
1 | nginx -V |
nginx version: nginx/1.17.6
built by gcc 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
built with OpenSSL 1.1.1 11 Sep 2018
TLS SNI support enabled
configure arguments: –prefix=/etc/nginx –sbin-path=./objs/nginx –modules-path=/usr/lib/nginx/modules –conf-path=/etc/nginx/nginx.conf –error-log-path=/var/log/nginx/error.log –http-log-path=/var/log/nginx/access.log –pid-path=/var/run/nginx.pid –lock-path=/var/run/nginx.lock –http-client-body-temp-path=/var/cache/nginx/client_temp –http-proxy-temp-path=/var/cache/nginx/proxy_temp –http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp –http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp –http-scgi-temp-path=/var/cache/nginx/scgi_temp –user=nginx –group=nginx –with-compat –with-file-aio –with-threads –with-http_addition_module –with-http_auth_request_module –with-http_dav_module –with-http_flv_module –with-http_gunzip_module –with-http_gzip_static_module –with-http_mp4_module –with-http_random_index_module –with-http_realip_module –with-http_secure_link_module –with-http_slice_module –with-http_ssl_module –with-http_stub_status_module –with-http_sub_module –with-http_v2_module –with-mail –with-mail_ssl_module –with-stream –with-stream_realip_module –with-stream_ssl_module –with-stream_ssl_preread_module –with-cc-opt=’-g -O2 -fdebug-prefix-map=/data/builder/debuild/nginx-1.17.6/debian/debuild-base/nginx-1.17.6=. -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC’ –with-ld-opt=’-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,–as-needed -pie’ –add-module=../ngx_cache_purge-2.3
5.2重新编译
- 提前准备好需要添加的第三方包源码
从网络下载对应的包
- 进入安装包目录
1 | cd /usr/local/nginx-1.17.6/ |
- configure 添加缺少的module
1 | ./configure --add-module=~/path/to/moduleFolder |
- 编译
1 | make |
- 替换
1 | # 备份原文件 |
- 重启服务
1 | systemctl restart nginx |
- 确认安装成功
1 | nginx -V |
- 本文作者: Linking
- 本文链接: https://linking.fun/2019/10/06/nginx安装后添加第三方module/
- 版权声明: 版权所有,转载请注明出处!