1

I'm trying to configure nginx to build the GeoIP2 module, by following this installation: https://github.com/leev/ngx_http_geoip2_module

first I still didn't understand what is defrences between static and dynamic modules, and why can't I just apt install that module..

The problemm is that I want to build/create it on a diffrent machine, so I had to copy the configure flags from the destination machine by copy the output of this command:

nginx -V

and then I ran this command on the test machine:

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

Then after succession I copied the file name: ngx_http_geoip2_module.so to destination machine and ran nginx -t I got this error:

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

My destination machine: Ubuntu 20 Nginx 1.20.1

iTaMaR
  • 189
  • 2
  • 10

2 Answers2

1

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

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 24 '21 at 12:40
0

My solution was to add --with-compat option. Here are the commands I used to build it on Almalinux 9.1:

git clone https://github.com/nginx/nginx.git
git clone https://github.com/leev/ngx_http_geoip2_module.git
cd nginx
git checkout release-1.22.1 # or whatever version you have
auto/configure --with-compat --with-stream --add-dynamic-module=../ngx_http_geoip2_module `nginx -V`
make
cp objs/ngx_http_geoip2_module.so /usr/lib64/nginx/modules/
cp objs/ngx_stream_geoip2_module.so /usr/lib64/nginx/modules/
Martin Dimitrov
  • 4,796
  • 5
  • 46
  • 62