LDAP & Debian & Linux & MacOS Daantje on 05 Oct 2008 08:10 pm
Use a Debian Slapd to sync MacOS X Address book
I’ve attempted this a lot of times. Now it works (sort of, but it still needs some tweaking). What you’ll need is a Debian server running a slapd daemon. You can get this with apt-get, of course… It could be handy to have the utils too and I use the GPL-ed handy web based ldap management tool phpldapadmin. I like it, it’s small and easy to work with… So the apt-get command should be like;
apt-get install slapd ldap-utils phpldapadmin
Now after you’ve configured your slapd and phpldapadmin you should be able to login into your ldap server. I used phpldapadmin for that. Remember that you’ll have to use the DN you’ve configured earlier. It look something like ‘cn=admin,dc=subdomain,dc=domain,dc=com’. Yes it’s the complete string, not only ‘admin’!
Now go to addressbookserver.com and download the latest version of ABxLDAP (AddressBook X LDAP), I’ve used for this how to ‘ABxLDAP_v1.1.16_31_May_2008.dmg’.
After you’ve installed it, check the mounted disk image. You should have a file called ‘abxldap.schema‘, it can be found in the folder ‘LDAP Schema Extension’. This file should be uploaded and placed into ‘/etc/ldap/schema’ on your Debian server. Edit your /etc/ldap/slapd.conf and add the schema with this include line;
include /etc/ldap/schema/abxldap.schema
Now restart the ldap server…
/etc/init.d/slapd restart
Now comes the magic… You’ll have to populate the ldap directory, so ABxLDAP can sync with it… What I did was this:
I’ve made a text file called ‘populate.ldif‘. This file contains the following text:
dn: ou=addressbook,dc=subdomain,dc=domain,dc=com objectClass: organizationalUnit ou: addressbook
NOTE: ‘dc=subdomain,dc=domain,dc=com’ should be what ever you’ve configured slapd with in the first step!
Now use phpldapadmin to import the ‘populate.ldif‘ into your ldap directory. When you don’t have any errors, you should be able to sync with ABxLDAP for the first time.
Go to your System Preferences on your Mac and pick the ABxLDAP panel. Fill all the fields. What I use is this:

Remember to quit your System Preferences after you filled all fields, and start it again and hit the Sync button, or else it will not work!
That’s it, all should be working fine. Every time you edit something in your Address Book on your Mac, it should sync the whole ldap. Also when you delete or edit a record directly on your ldap, it will sync. The only thing I’ve to figure out is, how to sync periodically, so the Mac always have the latest version. Now it only syncs when something is changed in your Address Book, or when you hit the sync button in your ABxLDAP in System Preferences.
Almost forgot to mention. In case of troubleshooting set in slapd.conf loglevel to 448 instead of 0 to get debug log messages in /var/log/syslog.
So more is coming later… Now it’s time for a beer!
3 Responses to “Use a Debian Slapd to sync MacOS X Address book”
Leave a Reply
You must be logged in to post a comment.
on 18 Nov 2008 at 6:20 pm 1.Angelo said …
Weird, I have a running openLDAP server (version 2.4.11) running on my Sparc Solaris 10 machine, but when I include the abxldap.schema the server doesn’t want to start anymore. If I take out the schema from the slapd.conf file it starts again without problems.
on 18 Nov 2008 at 6:27 pm 2.Daantje said …
Sorry, Solaris is not my thing… Try to ask bokko.nl, those geeks are Solaris based ;)
on 18 Nov 2008 at 7:07 pm 3.Angelo said …
Hi, well I\’ve figured it out. Kinda :) I should include more of the schema files. I can start it now and with Apache Directory Studio I can log into the server. It also has an import function for LDIF files, but I get an error:
Error while importing LDIF
[LDAP: error code 32 - No Such Object]
[LDAP: error code 32 - No Such Object]