leev / ngx_http_geoip2_module

Nginx GeoIP2 module
BSD 2-Clause "Simplified" License
983 stars 186 forks source link

error loading module: only ET_DYN and ET_EXEC can be loaded #85

Closed ffabreti closed 4 years ago

ffabreti commented 4 years ago

Please excuse me for asking it here, but I have followed the docs and the module did not loaded. I have done this:

wget http://nginx.org/download/nginx-1.15.12.tar.gz
wget https://github.com/leev/ngx_http_geoip2_module/archive/master.zip
wget https://github.com/maxmind/libmaxminddb/releases/download/1.4.2/libmaxminddb-1.4.2.tar.gz
cd libmaxminddb-1.4.2/
./configure
make
make check
make install
ldconfig
cd ../nginx-1.15.12/
yum install pcre pcre-devel zlib zlib-devel openssl-devel
./configure --add-dynamic-module=/root/geoip2_nginx/ngx_http_geoip2_module-master
make
cd objs
#copy to docker volume...
cp ngx_http_geoip2_module_modules.o /srv/nginx/lib/
vim nginx.conf
    load_module /etc/nginx/lib/ngx_http_geoip2_module_modules.o;

nginx source and nginx docker are the same version 1.15

docker stop nginx
docker start nginx
docker logs -f nginx

2020/01/27 19:29:08 [emerg] 1#1: dlopen() "/etc/nginx/lib/ngx_http_geoip2_module_modules.o" failed (/etc/nginx/lib/ngx_http_geoip2_module_modules.o: only ET_DYN and ET_EXEC can be loaded) in /etc/nginx/nginx.conf:5

Any clues?

ffabreti commented 4 years ago

my mistake, sorry

olegsidokhmetov commented 4 years ago

I have the same error

after restart nginx I have errors: root@NC-V3:~/geoip2influx# nginx -t nginx: [emerg] dlopen() "/usr/share/nginx/modules/ngx_http_geoip2_module.o" failed (/usr/share/nginx/modules/ngx_http_geoip2_module.o: only ET_DYN and ET_EXEC can be loaded) in /etc/nginx/nginx.conf:6

root@NC-V3:/usr/share/nginx/modules# ls ngx_http_geoip2_module.o ngx_http_image_filter_module.so ngx_http_xslt_filter_module.so ngx_mail_module.so ngx_stream_module.so

Is this Ok that end of the file has "o'?