十三、给已安装的nginx动态添加模块

给已安装的nginx动态添加模块
说明:已经安装好的nginx,需要添加一个未被编译安装的模块,需要怎么弄呢?
具体:
这里以安装 --with-http_ssl_module模块为例
nginx的模块是需要重新编译nginx,而不是像apache一样配置文件引用.so
1.查看nginx编译安装时安装了哪些模块
[root@proxy nginx-1.12.2]# nginx -V
nginx version: nginx/1.12.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
configure arguments: --with-http_gzip_static_module
可以看出编译安装使用了--with-http_gzip_static_module
2.加入需要安装的模块,重新编译:--with-http_ssl_module
[root@proxy nginx-1.12.2]# ./configure --with-http_gzip_static_module --with-http_ssl_module
[root@proxy nginx-1.12.2]# make #千万千万不能 make install ;否则会把之前已经安装的nginx 覆盖掉
3.备份原有已安装好的nginx
[root@proxy nginx-1.12.2]# cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
4.把新的nginx程序覆盖旧的
[root@proxy nginx-1.12.2]# cp -rfp objs/nginx /usr/local/nginx/sbin/
5.5.验证并重启新程序
[root@proxy nginx-1.12.2]# nginx -V
nginx version: nginx/1.12.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --with-http_gzip_static_module --with-http_ssl_module

注:删除模块与其类似

posted @ 2021-06-15 11:35  落樰兂痕  阅读(175)  评论(0编辑  收藏  举报