Installing Nginx module in the case of installed Nginx
nginx third-party module installation method:
The code is as follows:
./configure--prefix=/Your installation directory--add-module=/third-party module directory
1. View the commands of Nginx compile installation, which modules are installedThe code is as follows:
#/usr/local/webserver/nginx/sbin/nginx-v
2. Switch to the root user
The code is as follows:
#su Root
3, in the installation of Nginx installed Nginx module (username is the system user name)
The code is as follows:
# sudo./configure--prefix=/usr/local/nginx--with-pcre=/home/username/Download/nginx/pcre-8.32--with-zlib=/home/ username/download/nginx/zlib-1.2.8--with-openssl=/home/username/download/nginx/openssl-1.0.2a--add-module=/home/username/ Download/nginx/nginx_mod_h264_streaming-2.2.7
# make
# CP Objs/nginx/usr/local/nginx/sbin/nginx
#. /usr/local/nginx-1.4.1/sbin/nginx
Compared to installing Nginx third party module without nginx installation, it is more than one step to overwrite Nginx file.
If you do not add sudo before the./configure, the following error message appears:
./configure:45:auto/init:cannot Create Makefile:permission denied./configure:16:./configure:cannot Create Objs/ngx_ Auto_headers.h:permission denied./configure:17:./configure:cannot Create Objs/autoconf.err:permission denied./ CONFIGURE:19:./configure:cannot create objs/ngx_auto_config.h:permission deniedchecking for OS + Linux 3.16.0-30-gener IC i686checking for C compiler ..../configure:8: auto/feature:cannot Create Objs/autoconf.err:permission Denied./config Ure:28:auto/feature:cannot Create objs/autotest.c:permission denied./configure:1: Eval:cannot Create OBJS/AUTOCONF.E Rr:permission denied not found./configure:116:auto/feature:cannot create objs/autoconf.err:permission denied./config Ure:117:auto/feature:cannot Create objs/autoconf.err:permission denied./configure:118:auto/feature:cannot Create OB Js/autoconf.err:permission Denied./configure:119:auto/feature:cannot Create Objs/autoconf.err:permission denied./ Configure:120:auto/feature:cannot Create objs/autoconf.err:permission Denied./configure:error:c compiler cc is not found
---------------------------------------
Solution:
sudo./configure--prefix=/usr/local/nginx--with-pcre=/home/user/Download/nginx/pcre-8.32--with-zlib=/home/user/download/ nginx/zlib-1.2.8--with-openssl=/home/user/download/nginx/openssl-1.0.2a--add-module=/home/user/download/nginx/nginx_mod_ h264_streaming-2.2.7
4. Summary
Installing a third-party module in the case of an installed Nginx is actually using –add-module to reinstall the Nginx, do not make install but directly to the compilation directory objs/ The Nginx file overwrites the old Nginx file directly. If you need to install multiple nginx third-party modules, you only need to specify several –add-module.
Note: When recompiling, remember to add the previously compiled modules to the Configure parameter.
Nginx provides a very many nginx third-party modules for installation, address Http://wiki.nginx.org/3rdPartyModules
Linux: Installing Nginx module in the case of installed Nginx