wiki:Howto_Ldap

Version 10 (modified by andudi, 2 years ago) (diff)

--

(This page is still under construction!)

LDAP Addressbook Server for Roundcube

This Howto describes the setup of a simple LDAP addressbook server that should be ready for using with Roundcube "out of the box". The goal is to have an addressbook solution similar to the SQL based one, including contact groups and configurable fields. On the other side it should be possible to connect with any LDAP addressbook client out there.

Since Rouncube 0.5 is not ready to work with LDAP contact groups, this feature will be available not before Rouncube 0.6. Nevertheless can the LDAP addressbook server allready be used with RC 0.5: new contacts do not belong to a group first, but this can be changed in later versions.

This Howto makes some simplifications that are maybe a good choice for a simple home server, but not what proffessionals would probably do:

  • this Howto is based on OpenLDAP (http://www.openldap.org)
  • the LDAP server is running on the same host as Roundcube
  • the static config file is used instead of the dynamic config directory
  • security issues are not part of this Howto
  • this Howto is based and tested on Debian Lenny and Ubuntu 10.10, but other Distros (and OS?) should work as well

If you have different needs, it should be possible to improve it: but will probably no longer run "out of the box" :-)

Install the LDAP Server

To install the OpenLDAP server just install the following packages with your favourite installer:

  • slapd
  • ldap-utils
  • php5-ldap

(if they are called different on your distro, please let me know) E.g. on Debian based systems:

$ sudo apt-get install slapd ldap-utils php5-ldap

Depending on your distribution (e.g. on Debian Lenny), you will be asked during the installation about informations like that:

  • domainname: localhost
  • organisation: Local LDAP Addressbook Server
  • administrator password: mypasswd

The proposed answers for domainname and organisation fit well with this Howto: if you want to change them you have to know how to adapt the dependecies in the following steps! Please change the password to your favorite one!

E.g. on Debian based systems, you can redo this preconfiguration:

$ sudo dpkg-reconfigure slapd

On other distros like Ubuntu 9.10 and above, you have to define the administration password in the configuration file. Then you have to generate it first (in this example the password is mypasswd as well):

$ sudo slappasswd
New password: 
Re-enter new password: 
{SSHA}bCiMXssO6JJ2ZsPikd1qjNuWhApr+fHr

Configure the LDAP Server

OpenLDAP supports two types of configuration:

  1. the static config file, usually /etc/ldap/slapd.conf
  2. the newer dynamic config directory, usually /etc/ldap/slapd.d/

Some distros like Debian Lenny still preconfigure the config file. Others like Ubuntu 9.10 and above are meant to use the config directory instead: then you have to change this behavour!

E.g. in Ubuntu 10.10 you have to edit the file /etc/default/slapd and change the first entry:

SLAPD_CONF=/etc/ldap/slapd.conf

Now you have to change or create the config file

Try to restart OpenLDAP then, e.g. on Debian based systems like

$ sudo invoke-rc.d slapd restart

you should now find the server options like:

$ ps -ef | grep slapd
openldap 19003     1  0 21:36 ?        00:00:00 /usr/sbin/slapd -g openldap -u openldap -f /etc/ldap/slapd.conf

Preparing the LDAP Server

Configuring Roundcube

Attachments (2)

Download all attachments as: .zip