Nginx之為已安裝nginx動(dòng)態(tài)添加模塊的方法
說(shuō)明:
已經(jīng)安裝好的nginx,需要添加一個(gè)未被編譯安裝的模塊,需要怎么弄呢?
具體:
這里以安裝第三方ngx_http_google_filter_module模塊為例
nginx的模塊是需要重新編譯nginx,而不是像apache一樣配置文件引用.so
1. 下載第三方擴(kuò)展模塊ngx_http_google_filter_module
# cd /data/software/ # git clone https://github.com/cuber/ngx_http_google_filter_module
2. 查看nginx編譯安裝時(shí)安裝了哪些模塊
# nginx -V nginx version: nginx/1.8.0 built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) built with OpenSSL 1.0.1e-fips 11 Feb 2013 TLS SNI support enabled configure arguments: --prefix=/usr/local/nginx --with-http_ssl_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --add-module=/data/software/ngx_http_substitutions_filter_module
可以看出編譯安裝使用了--prefix=/usr/local/nginx --with-http_ssl_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --add-module=/data/software/ngx_http_substitutions_filter_module這些參數(shù)。--add-module=/data/software/ngx_http_substitutions_filter_module是之前編譯添加ngx_http_substitutions_filter_module模塊時(shí)添加
3. 加入需要安裝的模塊,重新編譯,如這里添加–add-module=/data/software/ngx_http_google_filter_module
# ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --add-module=/data/software/ngx_http_substitutions_filter_module --add-module=/data/software/ngx_http_google_filter_module # make //千萬(wàn)不要make install,不然就真的覆蓋了
4. 替換nginx二進(jìn)制文件:
# cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak # cp ./objs/nginx /usr/local/nginx/sbin/
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
解決Nginx 配置 proxy_pass 后 返回404問(wèn)題
這篇文章主要介紹了Nginx 配置 proxy_pass 后 返回404問(wèn)題,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2021-01-01
nginx無(wú)法獲取帶下劃線的header值的問(wèn)題解決
Nginx默認(rèn)會(huì)將連字符轉(zhuǎn)換為下劃線,這可能會(huì)導(dǎo)致無(wú)法正確獲取到原始的請(qǐng)求頭值,本文主要介紹了nginx無(wú)法獲取帶下劃線的header值的問(wèn)題解決,感興趣的可以了解一下2024-12-12
Nginx實(shí)現(xiàn)瀏覽器可實(shí)時(shí)查看訪問(wèn)日志的步驟詳解
我們經(jīng)常需要在頁(yè)面上實(shí)時(shí)查看nginx的日志輸出,并且能在頁(yè)面上顯示,那么下面小編就給大家說(shuō)下怎么在瀏覽器上實(shí)時(shí)動(dòng)態(tài)的查看nginx的訪問(wèn)日志,有需要的朋友們可以參考借鑒。2016-09-09
nginx 代理80端口轉(zhuǎn)443端口的實(shí)現(xiàn)
這篇文章主要介紹了nginx 代理80端口轉(zhuǎn)443端口的實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2020-09-09
keepalived結(jié)合nginx實(shí)現(xiàn)nginx高可用的方法
這篇文章主要介紹了keepalived結(jié)合nginx實(shí)現(xiàn)nginx高可用的方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-03-03

