0

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

我的安装方式:

  1. 光盘/选择/
  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.所以'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.

谁是我的失败或问题?

4

1 回答 1

0

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

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

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

于 2019-02-23T17:25:16.510 回答