0
votes

i have Problem with compile "geoip2" for nginx. my ".so" is not working.

my install way:

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

... test ! -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]: Leaving directory '/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. adding the line load_module "modules/ngx_http_geoip2_module.so"; in my nginx.conf an restart nginx.

and after restart is geoip2 not loaded in my nginx install

nginx version: nginx/1.15.8 built with OpenSSL 1.1.1 11 Sep 2018 (running with OpenSSL 1.1.1a 20 Nov 2018) TLS SNI support enabled configure arguments: --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

who is my fail or problem?

1

1 Answers

0
votes

There is no problem. You seem to be copying the dynamic module to existing nginx installation.

The nginx -V will show the configure command that was used while compiling nginx. So it won't show configure options for the dynamic module that you compiled in a separate step, and it won't show loaded modules.

Just use the module's directives. It should work.