The Back-sql how to
First, get the files from Adam's folder on back-sql. You'll find them here. You'll need to modify the create script to reflect the LDAP directory structure of your installation. Personally, I just removed the ou=SubSystems and changed the dc to be dc=mydomain,dc=ca. Next, follow the links that Adam has listed to set-up the various software dependencies to get a working OpenLDAP directory. Those will vary by distribution, so you may have to google for answers. I'm running Debian testing (Sarge), so I needed slapd, odbc-postgresql, unixodbc, and postgresql.
At this point, you should have a working LDAP in order to continue. You will need to put the opengroupware.schema file in the schema directory for your OpenLDAP installation (for me, /etc/ldap/schema). You will also need the evolutionperson.schema file put in the same place (I've got one here that came from Debian's eds1.0 package). 'su' to postgres, and import the create sql file that you have already customized for your particular directory.
# su postgres postgres@host: psql ogo ogo < ogo-back-sql-create.sql ## assumes your database is 'ogo', and your user is 'ogo'
Now you'll need to edit your odbc files. First do /etc/odbc.ini (or equivalent on your distro), and add the following lines, based of course on the specifics for your installation.
[Ogo] Driver= /usr/lib/odbc/psqlodbc.so Setup= /usr/lib/odbc/libodbcpsqlS.so Description=The OpenGroupware Database Servername=localhost Port=5432 Protocol=7.4 FetchBufferSize=99 Username=ogo Password=YOUR-OGO-PASSWORD Database=ogo ReadOnly=no RowVersioning = No ShowSystemTables = No ShowOidColumn = No FakeOidIndex = No ConnSettings =
Now, cd to your ldap directory, and get to work on slapd.conf
# Schema and objectClass definitions include /etc/ldap/schema/core.schema include /etc/ldap/schema/cosine.schema include /etc/ldap/schema/nis.schema include /etc/ldap/schema/inetorgperson.schema include /etc/ldap/schema/opengroupware.schema include /etc/ldap/schema/samba.schema include /etc/ldap/schema/evolutionperson.schema moduleload back_sql backend bdb backend sql ################################################## # OGo Database back-sql # MUST be BEFORE your bdb or ldbm "regular" ldap database database sql subordinate suffix "ou=OpenGroupware,dc=mydomain,dc=ca" dbname ogo dbuser ogo dbpasswd YOUR-OGO-PASSWORD lastmod off # new to OpenLDAP v2.1.x has_ldapinfo_dn_ru no # PostgreSQL insentry_query "insert into ldap_entries (id,dn,oc_map_id,parent,keyval) values ((select max(id)+1 from ldap_entries),?,?,?,?)" upper_func "upper" strcast_func "text" concat_pattern "?||?"
I used subordinate in order to get it working on my system, since the bdb database is the "root" of my directory. This way, it places ou=OpenGroupware in the top level of my directory, and it's browseable. Put appropriate security on your access control... that's beyond my ability to put here in this simple how-to.
Hope this helps! It makes your OGo database available in any mail client's ldap address book, by putting in a search dn of "ou=OpenGroupware,dc=mydomain,dc=ca". It's really quite slick!
Special thanks go to Adam (aka whitemice) for all his hard work putting together the postgresql views, schema files and create/drop scripts that make this all possible. This how-to is merely to suppliment the work he's done, by making it more understandable by those with lesser ldap/sql skills (like me!).