Page 1 of 1

lighttpd + mod_auth with LDAP backend

Posted: 24 Mar 2015 13:18
by BGMogli

I would like to use the mod_auth capabilities of lighttpd with the LDAP backend (especially for WebDAV).
I tried setting it up yesterday, but it kept denying my authentication requests forever and only printed following messages to the log:

Code: Select all

nas lighttpd[7149]: (http_auth.c.887) password doesn't match for / username: admin, IP:
After checking out the source of http_auth.c I found out that if lighttpd wasn't compiled with the LDAP option, it would just deny the authentication, resulting in given error message. The output of lighttpd -V shows that LDAP support is missing (in current build: - Nayla (revision 1349)).

Code: Select all

nas: ~ # lighttpd -V
lighttpd/1.4.35 (ssl) - a light and fast webserver
Build-Date: Feb 10 2015 00:13:46
	- LDAP support
So I tried figuring out how I could solve that problem. I started setting up a proper build environment with a VM of FreeBSD 9.3-RELEASE, mostly based on ... om_scratch, which is a bit outdated but if you know how to get the sources via SVN, it's half the battle.
So I started modifying the lighttpd port in /usr/local/nas4free/svn/build/ports/lighttpd. In the Makefile I did set --with-ldap and installed net/openldap24-client (which contains the probably used) from ports. I also added to LIB_DEPENDS. Anyway, it wouldn't build lighttpd with LDAP enabled, giving me on make following messages in the output:
===> lighttpd-1.4.35 depends on shared library: - found (/usr/local/lib/
checking for LDAP support... yes
checking for ldap_bind in -lldap... no
In the port www/lighttpd you can use make config and enable the LDAP feature, but I couldn't find out what I am missing in my configuration since this is my first time messing with ports.

Can anyone point me in the right direction what to do? And is it possible to include this feature in upcoming releases of NAS4Free?