| 147 | | Next we have to setup a directory structure such that Roundcube can operate on it. Use the following shell script (bash) as administrator on the server (sudo or as root): |
| 148 | | {{{ |
| 149 | | |
| 150 | | }}} |
| | 148 | Next we have to setup a directory structure such that Roundcube can operate on it. Download the following shell script, configure the first few lines in it, and execute it as administrator on the server (sudo or as root): [[http://trac.roundcube.net/raw-attachment/wiki/Howto_Ldap/rcabook-setup.sh|rcabook-setup.sh]] |
| | 149 | |
| | 150 | You should get something like that: |
| | 151 | {{{ |
| | 152 | $ sudo bash rcabook-setup.sh |
| | 153 | This script prepares an openLDAP server for a simple |
| | 154 | addressbook, working "out of the box" with Roundcube: |
| | 155 | |
| | 156 | server: ldap://localhost:389 |
| | 157 | org : Local LDAP Addressbook Server |
| | 158 | config: /etc/ldap/slapd.conf |
| | 159 | suffix: dc=localhost |
| | 160 | rootdn: cn=admin,dc=localhost |
| | 161 | |
| | 162 | -create the openLDAP base directory: dc=localhost |
| | 163 | (as LDAP administator: cn=admin,dc=localhost) |
| | 164 | Enter LDAP Password: |
| | 165 | adding new entry "dc=localhost" |
| | 166 | |
| | 167 | -create the addressbook user: cn=rcuser,dc=localhost |
| | 168 | (as LDAP administator: cn=admin,dc=localhost) |
| | 169 | Enter LDAP Password: |
| | 170 | adding new entry "cn=rcuser,dc=localhost" |
| | 171 | |
| | 172 | -create addressbook base directory: ou=rcabook,dc=localhost |
| | 173 | (as LDAP administator: cn=admin,dc=localhost) |
| | 174 | Enter LDAP Password: |
| | 175 | adding new entry "ou=rcabook,dc=localhost" |
| | 176 | |
| | 177 | -create subdirectory for contacts: ou=contacts,ou=rcabook,dc=localhost |
| | 178 | (as Roundcube user: cn=rcuser,dc=localhost) |
| | 179 | adding new entry "ou=contacts,ou=rcabook,dc=localhost" |
| | 180 | |
| | 181 | -create subdirectory for groups: ou=groups,ou=rcabook,dc=localhost |
| | 182 | (as Roundcube user: cn=rcuser,dc=localhost) |
| | 183 | adding new entry "ou=groups,ou=rcabook,dc=localhost" |
| | 184 | |
| | 185 | The LDAP addressbook is ready now for using: |
| | 186 | base_dn: ou=rcabook,dc=localhost |
| | 187 | bind_dn: cn=rcuser,dc=localhost |
| | 188 | |
| | 189 | Use the following command for reading and checking your setup: |
| | 190 | ldapsearch -xLLL -H ldap://localhost:389 -D cn=rcuser,dc=localhost -w rcpass -b dc=localhost |
| | 191 | }}} |
| | 192 | If you run the proposed ldap search query, you should get something like: |
| | 193 | {{{ |
| | 194 | $ ldapsearch -xLLL -H ldap://localhost:389 -D cn=rcuser,dc=localhost -w rcpass -b dc=localhost |
| | 195 | dn: dc=localhost |
| | 196 | objectClass: top |
| | 197 | objectClass: dcObject |
| | 198 | objectClass: organization |
| | 199 | dc: localhost |
| | 200 | o: Local LDAP Addressbook Server |
| | 201 | |
| | 202 | dn: cn=rcuser,dc=localhost |
| | 203 | cn: rcuser |
| | 204 | userPassword:: e1NTSEF9TzZERjI2WXB1a1FKcS93V0NKWFJpL0FBY2hia3czdEk= |
| | 205 | objectClass: organizationalRole |
| | 206 | objectClass: simpleSecurityObject |
| | 207 | |
| | 208 | dn: ou=rcabook,dc=localhost |
| | 209 | ou: rcabook |
| | 210 | objectClass: top |
| | 211 | objectClass: organizationalUnit |
| | 212 | |
| | 213 | dn: ou=contacts,ou=rcabook,dc=localhost |
| | 214 | ou: contacts |
| | 215 | objectClass: top |
| | 216 | objectClass: organizationalUnit |
| | 217 | |
| | 218 | dn: ou=groups,ou=rcabook,dc=localhost |
| | 219 | ou: groups |
| | 220 | objectClass: top |
| | 221 | objectClass: organizationalUnit |
| | 222 | }}} |
| | 223 | If you see at least this 5 entries, your LDAP addressbook server is now ready to be filled with content. |
| | 224 | |
| | 225 | |
| | 227 | |
| | 228 | |
| | 229 | == Other Clients than Roundcube == |
| | 230 | There exists a lot of addressbook clients that can connect to a LDAP server. The most of them do not support contact groups yet, and the number of supported contact fields is often verry limited (please let me now if your expericance is different). |
| | 231 | |
| | 232 | Usually you have to set the following fields: |
| | 233 | - the hostname, or even the IP address |
| | 234 | - the ldap port: 389 |
| | 235 | - the bind_dn: "cn=rcuser,dc=localhost" |
| | 236 | - the bind_pw: rcpass |
| | 237 | - the base_dn: "ou=contacts,ou=rcabook,dc=localhost" |
| | 238 | - optional a filter: object_class=inetOrgPerson |
| | 239 | |
| | 240 | == Finally == |
| | 241 | If you have answers about this Howto, or even if you do not agree with something: please send an email to andudi[at]gmx[dot]ch or even to the Roundcube developer mail list, thanks. |
| | 242 | |
| | 243 | Andreas Dick |