Fix LDAP authentication under Apache on Synology's DSM 5.0

I’ve been using basic authentication with LDAP to secure web content on our DiskStation.

It wasn’t easy to get it to work in the first place as it is not directly supported by Synology but what provided the missing clue was this guide on the Synology forums: http://forum.synology.com/enu/viewtopic.php?f=34&t=42058.

Since the update to DSM 5.0 a lot of people have had problems with their existing basic authentication setups. Even a very simple authentication against a htpasswd file doesn’t work out of the box. Most of the changes and problems are discussed here: http://forum.synology.com/enu/viewtopic.php?f=232&t=79801

When using HTTPS the key to making basic authentication against a password file work again is disabling SPDY support in the web section of the control panel.

This still leaves authentication against LDAP broken after the update to DSM 5.0.

The fix for that is actually the same as for how to make it work under DSM 4.x – install the apr-util ldap library.

The difference is the location where you need to copy the library.

The HTTPD_ROOT for the user apache instance on DSM 5.0 is /usr/syno. You can check this by executing:

httpd -V

This means that apache is actually looking for the apr libraries in /usr/syno/lib/apr-util-1 instead of /usr/syno/apache/lib/apr-util-1 as it was before the update.

I downloaded an i386 debian package of the LDAP apr library for APR version 1.5.2 (the apache webserver is compiled against this version, again check with ‘httpd -V‘) here and extracted the library into /usr/syno/lib/apr-util-1.

Restart your user apache instance by executing

httpd -k restart

and basic authentication against a LDAP directory works again!

Timo

Timo