簡體   English   中英

nginx的geoip2不起作用

[英]geoip2 for nginx not wirking

我為nginx編譯“ geoip2”時遇到問題。 我的“ .so”不起作用。

我的安裝方式:

  1. cd / opt /
  2. sudo add-apt-repository ppa:maxmind / ppa && apt更新&sudo apt install libmaxminddb0 libmaxminddb-dev mmdb-bin
  3. git clone https://github.com/leev/ngx_http_geoip2_module.git
  4. wget http://nginx.org/download/nginx-1.15.8.tar.gz && tar xzfv nginx-1.15.8.tar.gz && cd nginx-1.15.8 /
  5. ./configure --with-compat --add-dynamic-module = / opt / ngx_http_geoip2_module && make &&進行安裝

...測試! -f'/usr/local/nginx/modules/ngx_http_geoip2_module.so'\\ || mv'/usr/local/nginx/modules/ngx_http_geoip2_module.so'\\'/usr/local/nginx/modules/ngx_http_geoip2_module.so.old'cp objs / ngx_http_geoip2_module.so'/ usr / local / nginx / modules / ngx_http_。因此,“ make [1]:離開目錄” /opt/nginx-1.15.8 ...

  1. cp /usr/local/nginx/modules/ngx_http_geoip2_module.so /usr/share/nginx/modules/ngx_http_geoip2_module.so

  2. 添加行load_module“ modules / ngx_http_geoip2_module.so”; 在我的nginx.conf中,重新啟動nginx。

重啟后,我的nginx安裝中沒有加載geoip2

nginx版本:使用OpenSSL 1.1.1構建的nginx / 1.15.8(2018年9月11日運行(使用OpenSSL 1.1.1a運行2018年11月20日))啟用TLS SNI支持的配置參數:--with-cc-opt ='-g -O2 -fdebug -prefix-MAP = /建造/ nginx的-2CZdMa / nginx的-1.15.8 =。 -fstack-protector-strong -Wformat -Werror =格式安全-fPIC -Wdate-time -D_FORTIFY_SOURCE = 2'--with-ld-opt ='-Wl,-符號函數-Wl,-z,relro -Wl ,-z,now -fPIC'--prefix = / usr / share / nginx --conf-path = / etc / nginx / nginx.conf --http-log-path = / var / log / nginx / access.log --error-log-path = / var / log / nginx / error.log --lock-path = / var / lock / nginx.lock --pid-path = / run / nginx.pid --modules-path = / usr / lib / nginx / modules --http-client-body-temp-path = / var / lib / nginx / body --http-fastcgi-temp-path = / var / lib / nginx / fastcgi --http- proxy-temp-path = / var / lib / nginx / proxy --http-scgi-temp-path = / var / lib / nginx / scgi --http-uwsgi-temp-path = / var / lib / nginx / uwsgi --with-compat --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with -http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module = dynamic --with-http_gunzip_module --with-http_gzip_static_module --with -http_image_filter_module =動態--with-http_sub_module --with-http_xslt_module =動態--with-stream =動態--with-stream_ssl_module --with-stream_ssl_preread_module --with-mail = dynamic --with-mail_ssl_module --add-dynamic -module = / build / nginx-2CZdMa / nginx-1.15.8 / debian / modules / http-auth-pam --add-dynamic-module = / build / nginx-2CZdMa / nginx-1.15.8 / debian / modules / http-dav-ext --add-dynamic-module = / build / nginx-2CZdMa / nginx-1.15.8 / debian / modules / http-echo --add-dynamic-module = / build / nginx-2CZdMa / nginx- 1.15.8 / debian / modules / http-upstream-fair --add-dynamic-module = / build / nginx-2CZdMa / nginx-1.15.8 / debian / modules / http-subs-filter

誰是我的失敗或問題?

沒有問題。 您似乎正在將動態模塊復制到現有的nginx安裝中。

nginx -V將顯示在編譯nginx時使用的configure命令。 因此,它不會在單獨的步驟中顯示動態模塊的配置選項,也不會顯示已加載的模塊。

只需使用模塊的指令即可。 它應該工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM