Configuring OpenLDAP, or what the @#$% !!!
OpenLDAP 2.3 (released in 2005) introduced a new way for configuring the slapd
daemon. The traditional method was a configuration file (/etc/ldap/slapd.conf
on Debian) that could simply be edited with a text editor. The new way follows the Eat your own dog food maxim: The configuration is stored in a set of LDIF files (stored under /etc/ldap/slapd.d
in Debian) which cannot be edited directly with a text editor. Instead, all changes must be done via LDAP operations. Funny enough: In order to configure the daemon, the daemon must already be running.
slapd-config, as the new configuration method is called, may be a technically cool feature, but from a casual sysadmin's point of view it is nothing but a major pain in the butt! So you want to quickly change slapd
's log level to diagnose some authentication problem? OK, first check the documentation to see where the log level option is located in the configuration schema, and how its attribute is called. Then query the running daemon to look at the current value(s). Then write an .ldif file that contains the change. Then issue a complicated ldapmodify
command that requires more cryptic options than tar
and cpio
combined. Of course the .ldif file contains an error, so diagnose & repeat. After maybe 20 minutes the job is done. Phew, only 20 minutes to change the daemon log level, I am such an LDAP wizard!
Actually when I did this just now it took me more like an hour because I am so not used to the procedure (another explanation might be that I'm just stupid, but hey, I think that's not it). Since I don't want to repeat the experience, I have started to write up some recipes on my wiki. Here's the link in case you are interested.
Comments
groundop
2016-05-10T13:30:02+02:00
Hi,
Hi,
sorry for stirring up old posts; but for modifying ldap via the commandline I have to recommend ldapvi. If you are familiar with using vim it should not be that complicated; and by calling ldapvi cn=config you can edit the slapd-config more easily.
Regards, groundop
patrick
2016-08-15T15:32:06+02:00
Excellent advice, thank you
Excellent advice, thank you so much! I didn't know about
ldapvi
, but it virtually saved my ass when I recently had to set up a new server! I added a new entry for ldapvi to my wiki.