0

我正在尝试configure通过以下安装使用 nginx 构建 GeoIP2 模块: https ://github.com/leev/ngx_http_geoip2_module

首先我还是不明白staticdynamic模块之间的定义是什么,为什么我不能只是apt install那个模块..

问题是我想在不同的机器上构建/创建它,所以我必须configure通过复制此命令的输出来从目标机器复制标志:

nginx -V

然后我在测试机器上运行了这个命令:

PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig/" ./configure --without-http_rewrite_module --without-http_gzip_module --add-module=/path/ngx_http_geoip2_module-3.3 (PASTE DESTINATION NGINX -V OUTPUT)
make
make install

然后在连续之后我将文件名复制ngx_http_geoip2_module.so到目标机器并运行nginx -t 我得到了这个错误:

nginx: [emerg] module "/etc/nginx/modules/ngx_http_geoip2_module.so" is not binary compatible in /etc/nginx/nginx.conf
nginx: configuration file /etc/nginx/nginx.conf test failed

我的目标机器:Ubuntu 20 Nginx 1.20.1

4

1 回答 1

0

--with-compat --add-module=/path/to/ngx_http_geoip2_module

--with-compat --add-dynamic-module=/path/to/ngx_http_geoip2_module

于 2021-09-24T11:39:10.010 回答