【问题标题】:geoip2 for nginx not wirkingnginx的geoip2不工作
【发布时间】:2019-02-23 16:55:21
【问题描述】:

我在为 nginx 编译“geoip2”时遇到问题。我的“.so”不起作用。

我的安装方式:

  1. cd /opt/
  2. sudo add-apt-repository ppa:maxmind/ppa && apt update & sudo apt install libmaxminddb0 libmaxminddb-dev mmdb-bin
  3. git 克隆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 && make install

...测试! -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。

重启后我的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=/build/nginx-2CZdMa/nginx-1.15.8=。 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -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=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --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 compilation geoip2


    【解决方案1】:

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

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

    只需使用模块的指令。它应该可以工作。

    【讨论】:

      猜你喜欢
      • 2021-09-16
      • 2017-06-03
      • 2023-03-19
      • 1970-01-01
      • 2013-05-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多