本文只是展示添加的方法,具體使用的模塊以自己的實際需求為準,以添加http_stub_status_module模塊為例:
一、查看已編譯引數
/usr/local/nginx/sbin/nginx -V 結果為:
--prefix=/usr/local/nginx --with-http_ssl_module --with-pcre=/opt/software/pcre-8.32 發現沒有http_stub_status_module模塊
二、重新編譯
1、進入nginx編譯安裝的目錄,加上--with-http_stub_status_module重新編譯
./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-pcre=/opt/software/pcre-8.32 --with-http_stub_status_module
2、執行make進行編譯,千萬不要執行make install,否則會把之前的nginx全部覆寫掉
3、備份原啟動檔案
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
4、替換啟動檔案(重新編譯好的檔案在/opt/software/nginx-1.10.1/objs/下)
cp /opt/software/nginx-1.10.1/objs/nginx /usr/local/nginx/sbin/nginx
5、驗證模塊是否已添加成功
/usr/local/nginx/sbin/nginx -V
執行后看到有http_stub_status_module模塊,說明添加成功。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/19011.html
標籤:服務器
上一篇:第十章 云存盤技術
