在安裝nginx後,發現少裝了一個模塊,不想從新安裝,能夠試試從新編譯nginxnginx
第一步ide
./configure \spa
--with-http_stub_status_module --prefix=/opt/nginx ip
--with-http_gzip_static_module(新加模塊)it
第二步編譯
注意make install會從新安裝,執行make便可。
class
第三步module
編譯完成後,會在目錄objs下生成新執行文件。將其覆蓋源文件
static
替換以前,先備份原執行文件 cp /nginx安裝目錄/nginx /nginx安裝目錄/nginx.bakdi
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(證實安裝成功)