Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Nginx is the method of dynamically adding modules to installed nginx.

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Description:

If you have already installed nginx, you need to add a module that has not been compiled and installed. What do you need to do?

Specific:

Here, take the installation of the third-party NGX _ http_google_filter_module module as an example

The module of nginx needs to recompile nginx instead of referencing .so in the configuration file like apache.

1. Download the third-party expansion module ngx_http_google_filter_module

# cd / data/software/# git clone https://github.com/cuber/ngx_http_google_filter_module

two。 See which modules are installed when nginx is compiled and installed

# nginx-Vnginx version: nginx/1.8.0built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) built with OpenSSL 1.0.1e-fips 11 Feb 2013TLS SNI support enabledconfigure arguments:-- prefix=/usr/local/nginx-- with-http_ssl_module-- with-http_sub_module-- with-http_gzip_static_module-- with-http_stub_status_module-- add-module=/data/software/ngx_http_substitutions_filter_module

You can see that the compilation installation uses these parameters-- prefix=/usr/local/nginx-- with-http_ssl_module-- with-http_sub_module-- with-http_gzip_static_module-- with-http_stub_status_module-- add-module=/data/software/ngx_http_substitutions_filter_module. -- add-module=/data/software/ngx_http_substitutions_filter_module is added when the ngx_http_substitutions_filter_module module was added before compilation

3. Add the modules that need to be installed and recompile, as add-add-module=/data/software/ngx_http_google_filter_module here

#. / configure-- prefix=/usr/local/nginx-- with-http_ssl_module-- with-http_sub_module-- with-http_gzip_static_module-- with-http_stub_status_module-- add-module=/data/software/ngx_http_substitutions_filter_module-- add-module=/data/software/ngx_http_google_filter_module# make / / Don't make install, otherwise it will really be covered

4. Replace the nginx binaries:

# cp / usr/local/nginx/sbin/nginx / usr/local/nginx/sbin/nginx.bak# cp. / objs/nginx / usr/local/nginx/sbin/

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report