In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
This paper takes nginx as an example to analyze the method of dynamically adding modules to installed nginx by nginx. Read the complete article, I believe that you have a certain understanding of nginx's method of dynamically adding modules to the installed nginx.
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.
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
See which modules are installed when nginx is compiled and installed
Change the command line to the directory where the nginx executor is located and type. / nginx-V, as follows:
[root@liuyazhuang121 sbin] #. / nginx-V
Nginx version: nginx/1.9.3
Built by gcc 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC)
Built with OpenSSL 1.0.2 22 Jan 2015
TLS SNI support enabled
Configure arguments:-prefix=/usr/local/nginx-1.9.3-- with-openssl=/usr/local/src/openssl-1.0.2-- with-pcre=/usr/local/src/pcre-8.37-- with-zlib=/usr/local/src/zlib-1.2.8-- with-http_ssl_module
[root@liuyazhuang121 sbin] #
You can see that the compilation installation uses these parameters-- prefix=/usr/local/nginx-1.9.3-- with-openssl=/usr/local/src/openssl-1.0.2-- with-pcre=/usr/local/src/pcre-8.37-- with-zlib=/usr/local/src/zlib-1.2.8-- with-http_ssl_module.
Add modules that need to be installed and recompile
Add-- add-module=/data/software/ngx_http_google_filter_module here
The details are as follows:
The copy code is as follows:
/ configure-- prefix=/usr/local/nginx-1.9.3-- with-openssl=/usr/local/src/openssl-1.0.2-- with-pcre=/usr/local/src/pcre-8.37-- with-zlib=/usr/local/src/zlib-1.2.8-- with-http_ssl_module-- add-module=/data/software/ngx_http_google_filter_module
As above, add all the parameters that previously installed Nginx, and finally add-- add-module=/data/software/ngx_http_google_filter_module
After that, we will compile as follows:
Make / / do not make install, or you will really overwrite it.
Replace nginx binaries to back up the original nginx executor
Cp / usr/local/nginx-1.9.3/sbin/nginx / usr/local/nginx-1.9.3/sbin/nginx.bak
Copy the newly compiled nginx executor to the / usr/local/nginx/sbin/ directory
Cp / opt/nginx/nginx / usr/local/nginx/sbin/
On the dynamic addition of modules for nginx to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.