This article is a mirror article of machine translation, please click here to jump to the original article.

View: 17054|Reply: 2

[Web] Implementation: The nginx dynamic addition module has been installed

[Copy link]
Posted on 12/7/2016 1:39:50 PM | | | |
Illustrate:
If you have already installed nginx, you need to add a module that has not been compiled and installed, how do you do it?

Specifically:
Here is an example of installing a third-party ngx_http_google_filter_module module
The module for nginx is that you need to recompile nginx, instead of configuring .so like apache does
1. Download the third-party extension ngx_http_google_filter_module

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

2. Check which modules are installed when you compile and install nginx

# nginx -V
nginx version: nginx/1.8.0
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure 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

It can be seen that the compilation and installation uses --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 these parameters. --add-module=/data/software/ngx_http_substitutions_filter_module was added when you added ngx_http_substitutions_filter_module module in the previous compilation

3. Add the module that needs to be installed and recompile it, such as adding –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 overwritten

4. Replace the nginx binary:

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

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

(Note, when executing this sentence, there may be an error, cp: cannot create regular file '/service/nginx-1.10.2/sbin/nginx': Text file busy, because the nginx file is still in use, when re-adding the module, it is best to stop nginx first!! )






Previous:nginx: [error] open() /nginx.pid failed (2: No such file or directory)
Next:nginx sets up proxy caching
 Landlord| Posted on 4/27/2018 10:18:10 AM |
nginx adds third-party modules, as well as enabling modules that are natively supported by nginx
http://www.itsvse.com/thread-4713-1-1.html
(Source: Architect_Programmer)
Reference article
Posted on 6/2/2019 12:54:39 AM |
Thanks for sharing
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com