uikyhtr 发表于 2017-2-7 10:07:41

nginx添加模块

                      在安装nginx后,发现少装了一个模块,不想重新安装,可以试试重新编译nginx

第一步
    ./configure \
   --with-http_stub_status_module --prefix=/opt/nginx
   --with-http_gzip_static_module(新加模块)
第二步
   注意make install会重新安装,执行make即可。

第三步
    编译完成后,会在目录objs下生成新执行文件。将其覆盖源文件

    替换之前,先备份原执行文件 cp /nginx安装目录/nginx /nginx安装目录/nginx.bak
    cp ./objs/nginx/nginx安装目录/nginx


   重启nginx nginx -s reload
    执行nginx -V查看 新模块加载

    configure arguments: --with-http_stub_status_module --prefix=/opt/nginx --with-http_gzip_static_module(证明安装成功)
                  

页: [1]
查看完整版本: nginx添加模块