nginx添加新的模块


在nginx添加新的模块

安装nginx 此处省略

查看当前的nginx模块

[root@localhost nginx-1.13.9]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.13.9
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
configure arguments: --prefix=/usr/local/nginx --with-http_secure_link_module --with-http_stub_status_module

在最后一行nginx后面是当前已经加载的模块

业务需要原来的模块已经不能满足,增加新的模块

进入安装目录

cd nginx-1.13.9/

./configure --prefix=/usr/local/nginx --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_image_filter_module --with-http_slice_module --with-mail --with-threads --with-file-aio --with-stream --with-mail_ssl_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-pcre  --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module  && make 

开始编译新加入的模块这里不需要 make install 如果你想覆盖掉 就在 && make 后面加上 make install

在当前目录下 用新的nginx 覆盖旧的nginx文件(在nginx关闭的情况下覆盖,如果不关闭会报错设备正忙)

cp objs/nginx /usr/local/nginx/sbin/nginx

查看nginx当前的新加入的模块

[root@localhost nginx-1.13.9]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.13.9
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_image_filter_module --with-http_slice_module --with-mail --with-threads --with-file-aio --with-stream --with-mail_ssl_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-pcre --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module

加入新的模块成功

点一杯奶茶


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM