nginx安装成功后如何添加未编译安装模块
原已经安装好的nginx,现在需要添加一个未被编译安装的模块:
nginx -V 可以查看原来编译时都带了哪些参数
原来的参数:
./configure --sbin-path=/usr/local/sbin --without-http-cache --with-http_stub_status_module --with-http_gzip_static_module --with-pcre=/usr/local/tools/pcre-8.33 --add-module=/usr/local/tools/nginx_mod_h264_streaming-2.2.7
添加的参数:
--with-http_flv_module
步骤如下:
1. 使用参数重新配置:
./configure --sbin-path=/usr/local/sbin --without-http-cache --with-http_stub_status_module --with-http_gzip_static_module --with-http_flv_module --with-pcre=/usr/local/tools/pcre-8.33 --add-module=/usr/local/tools/nginx_mod_h264_streaming-2.2.7
2. 编译:
make
#不要make install,否则就是覆盖安装
3. 替换nginx二进制文件:
备份一下原命令
#cp /usr/local/sbin/nginx /usr/local/sbin/nginx.bak
复制新的命令
# cd nginx-1.4.3/objs/
cp ./nginx /usr/local/sbin/
添加 --with-http_mp4_module
./configure --sbin-path=/usr/local/sbin --without-http-cache --with-http_stub_status_module --with-http_gzip_static_module --with-http_mp4_module --with-http_flv_module --with-pcre=/usr/local/tools/pcre-8.33 --add-module=/usr/local/tools/nginx_mod_h264_streaming-2.2.7
添加ssl模块:
./configure --sbin-path=/usr/local/sbin --without-http-cache --with-http_stub_status_module --with-http_gzip_static_module --with-http_mp4_module --with-http_flv_module --with-pcre=/usr/local/tools/pcre-8.33 --add-module=/usr/local/tools/nginx_mod_h264_streaming-2.2.7 --with-http_ssl_module