nginx的geoip2不起作用

时间:2019-02-23 16:55:22

标签: nginx compilation geoip2

我为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_geoip2_module.so'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。

重启后,geoip2没有加载到我的nginx安装中

  

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 = / build / 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

谁是我的失败或问题?

1 个答案:

答案 0 :(得分:0)

没有问题。您似乎正在将动态模块复制到现有的nginx安装中。

nginx -V将显示在编译nginx时使用的configure命令。因此,它不会在单独的步骤中显示动态模块的配置选项,也不会显示已加载的模块。

只需使用模块的指令即可。应该可以。