在已安裝nginx情況下安裝nginx模組
nginx第三方模組安裝方法:
程式碼-module=/第三方模組目錄
1、.查看nginx編譯安裝時的指令,安裝了哪些模組
程式碼如下:
#/usr/local/webserver/nginx/sbin/nginx -V代碼如下:
#su root
程式碼如下:
# sudo ./configure --prefix=/usr/local/nginx --with-pcre=/home/username/下載/nginx/pcre-8.32 ---zlib =/home/username/下載/nginx/zlib-1.2.8 --with-openssl=/home/username/下載/nginx/openssl-1.0.2a --add-module=/home/username/下載/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
安裝nginx的情況下安裝nginx第三方模組,
多了一步覆蓋nginx檔.
./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
4、總結
下安裝第三方模組其實是使用–add-module重新安裝一次nginx,不要make install而是直接把編譯目錄下objs/nginx檔直接覆蓋舊的nginx檔.如果你需要安裝多個nginx第三方模組,你只需要多指定幾個對應的–add-module即可.
備註:重新編譯的時候,記得一定要把以前編譯過的模組一同加到configure參數裡面.
nginx提供了非常多的nginx第三方模組提供安裝,網址http://wiki.nginx.org/3rdPartyModules
以上就介紹了Linux:在已安裝nginx情況下安裝nginx模組,包括了方面的內容,希望對PHP教程有興趣的朋友有所幫助。