leev / ngx_http_geoip2_module

Nginx GeoIP2 module
BSD 2-Clause "Simplified" License
960 stars 182 forks source link

Inquiry: libmaxminddb0 needed after compiling? #72

Closed teward closed 4 years ago

teward commented 5 years ago

This is more a general inquiry, but is libmaxminddb0 a build dependency or is it also a runtime dependency post-build? That is, if I do a Dynamic Module build and move the module to another computer running the same nginx but it does not have libmaxminddb0 installed, will the module still function?

dvershinin commented 5 years ago

@teward , I guess it depends on your specific compilation arguments. But if you're not doing anything special and just compiling the dynamic module, it will have a dependency on the library.

To verify this, run ldd on the compiled module file. E.g. ldd /etc/nginx/modules/ngx_http_geoip2_module.so:

linux-vdso.so.1 =>  (0x00007fff2b787000)
libmaxminddb.so.0 => /lib64/libmaxminddb.so.0 (0x00007f98369e6000)
libc.so.6 => /lib64/libc.so.6 (0x00007f9836619000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9836df0000)

If you also have libmaxminddb.so.0 in the output, then it means that your module requires libmaxminddb to be installed on a machine that uses the module file.

ffabreti commented 4 years ago

What steps would be necessary to embed libmaxminddb inside ngx_http_geoip2_module.so ?

I'm running docker, so it would be easier if I don't have to copy files and run ldconfig inside container.