在已安装nginx情况下安装nginx模块
相比在未安装nginx的情况下安装nginx第三方模块,多了一步覆盖nginx文件.
如果在./configure前不加 sudo,会出现以下错误提示:
./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 denied checking for OS + Linux 3.16.0-30-generic i686 checking for C compiler ..../configure: 8: auto/feature: cannot create objs/autoconf.err: Permission denied ./configure: 28: auto/feature: cannot create objs/autotest.c: Permission denied ./configure: 1: eval: cannot create objs/autoconf.err: Permission denied not found ./configure: 116: auto/feature: cannot create objs/autoconf.err: Permission denied ./configure: 117: auto/feature: cannot create objs/autoconf.err: Permission denied ./configure: 118: auto/feature: cannot create objs/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
---------------------------------------
解决方案:
sudo ./configure --prefix=/usr/local/nginx --with-pcre=/home/user/下载/nginx/pcre-8.32 --with-zlib=/home/user/下载/nginx/zlib-1.2.8 --with-openssl=/home/user/下载/nginx/openssl-1.0.2a --add-module=/home/user/下载/nginx/nginx_mod_h264_streaming-2.2.7
在已安装nginx情况下安装第三方模块实际上是使用–add-module重新安装一次nginx,不要make install而是直接把编译目录下objs/nginx文件直接覆盖旧的nginx文件.如果你需要安装多个nginx第三方模块,你只需要多指定几个相应的–add-module即可.
备注:重新编译的时候,记得一定要把以前编译过的模块一同加到configure参数里面.
nginx提供了非常多的nginx第三方模块提供安装,地址http://wiki.nginx.org/3rdPartyModules
原文地址:http://blog.csdn.net/sange77/article/details/45812301