kvspb / nginx-auth-ldap

LDAP authentication module for nginx
BSD 2-Clause "Simplified" License
731 stars 251 forks source link

Missing Shared Object #233

Open bandwiches opened 4 years ago

bandwiches commented 4 years ago

Hi!

I am having an issue with the shared object not being created after configure/make. It seems like it's building it but the object is not located in the /objs directory or the /usr/local/nginx/modules directory.

OS: Alpine:3.10 Nginx: 1.17.9

Nothing I seems to get past this error.

nginx: [emerg] unknown directive "ldap_server" in /usr/local/nginx/conf/nginx.conf:35

ldap_server is within my http block and outside of server blocks.

When I add the "load_module" just for kicks in my nginx.conf, it can't load the module because it doesn't exist (expected).

nginx: [emerg] dlopen() "/usr/local/nginx/modules/nginx-auth-ldap-0.1.so" failed (Error loading shared library /usr/local/nginx/modules/nginx-auth-ldap-0.1.so: No such file or directory) in /usr/local/nginx/conf/nginx.conf:1

I've tried from source, I've tried from official Nginx images, I've tried everything and nothing seems to work. Here is the output where it seems the object is built:

Nginx Configure Flags:

--prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --with-perl_modules_path=/usr/lib/perl5/vendor_perl --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-Os -fomit-frame-pointer' --with-ld-opt=-Wl,--as-needed

My addition:

...--add-dynamic-module=../nginx-auth-ldap-0.1

Output:

configuring additional dynamic modules
adding module in /nginx-auth-ldap-0.1/
 + ngx_http_auth_ldap_module was configured
checking for PCRE library ... found
checking for PCRE JIT support ... found
checking for zlib library ... found
creating objs/Makefile

Configuration summary
  + using system PCRE library
  + OpenSSL library is not used
  + using system zlib library

  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx modules path: "/usr/local/nginx/modules"
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"

make modules does nothing

/nginx-1.17.9 # make modules
make -f objs/Makefile modules
make[1]: Entering directory '/nginx-1.17.9'
make[1]: Nothing to be done for 'modules'.
make[1]: Leaving directory '/nginx-1.17.9'

Output of objs directory:

/nginx-1.17.9 # ls -la objs
total 96
drwxr-xr-x    4 root     root          4096 Mar  7 22:40 .
drwxr-xr-x    9 1001     1001          4096 Mar  7 22:40 ..
-rw-r--r--    1 root     root         40596 Mar  7 22:40 Makefile
drwxr-xr-x    3 root     root          4096 Mar  7 22:40 addon
-rw-r--r--    1 root     root         17934 Mar  7 22:40 autoconf.err
-rw-r--r--    1 root     root          6946 Mar  7 22:40 ngx_auto_config.h
-rw-r--r--    1 root     root           657 Mar  7 22:40 ngx_auto_headers.h
-rw-r--r--    1 root     root          5969 Mar  7 22:40 ngx_modules.c
drwxr-xr-x    9 root     root          4096 Mar  7 22:40 src

Output of Modules directory:

/nginx-1.17.9 # ls -la /usr/lib/nginx/modules
total 2272
drwxr-xr-x    2 root     root          4096 Mar  4 17:32 .
drwxr-xr-x    3 root     root          4096 Mar  4 17:32 ..
-rwxr-xr-x    1 root     root         19952 Mar  3 17:37 ngx_http_geoip_module-debug.so
-rwxr-xr-x    1 root     root         19952 Mar  3 17:37 ngx_http_geoip_module.so
-rwxr-xr-x    1 root     root         27288 Mar  3 17:37 ngx_http_image_filter_module-debug.so
-rwxr-xr-x    1 root     root         23192 Mar  3 17:37 ngx_http_image_filter_module.so
-rwxr-xr-x    1 root     root        537928 Mar  3 17:38 ngx_http_js_module-debug.so
-rwxr-xr-x    1 root     root        533832 Mar  3 17:38 ngx_http_js_module.so
-rwxr-xr-x    1 root     root         23272 Mar  3 17:39 ngx_http_xslt_filter_module-debug.so
-rwxr-xr-x    1 root     root         23272 Mar  3 17:39 ngx_http_xslt_filter_module.so
-rwxr-xr-x    1 root     root         19584 Mar  3 17:37 ngx_stream_geoip_module-debug.so
-rwxr-xr-x    1 root     root         19584 Mar  3 17:37 ngx_stream_geoip_module.so
-rwxr-xr-x    1 root     root        524968 Mar  3 17:38 ngx_stream_js_module-debug.so
-rwxr-xr-x    1 root     root        524968 Mar  3 17:38 ngx_stream_js_module.so