[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Setting up LDAP database

You are correct about how to defined the Object Class and the attributes.  The syntax is pretty straight forward if you look at the existing file.  You should look through the existing object classes in slapd.oc.conf because there may be an object class already defined with covers what you are trying to do.

One thing worth noting is that you shouldn't continue to compare LDAP to SQL, they are structured very differently.  An Object class isn't like an SQL table. An object class is more like a class definition in c++.  It is basically a structure that you use to give some order to the data in your directory.  A single entry in LDAP can be a member of several object classes (and generally each entry is a member of several objectclasses).  This membership to these objectclasses defines what attributes that this entry must contain and what entries it is allowed to contain in order for it to be a valid entry (this is done by your ldap server checking each modification and new entry for proper attributes if the changes you are trying to make don't conform to the schema you will get an error message.  Schema checking can be disabled, but it is best if you leave it on).  You should read through the LDAP Administrator's Guide   (http://www.openldap.org/doc/admin/) that will give you a good feel for what LDAP is and how the objecclasses work.

As far as entering data into your database, the easiest way to do this would probably be to create a LDIF file that contains all of your initial entries and data and then use the ldapadd command to import it.  For info on creating ldif files look at:  http://www.openldap.org/doc/admin/quickstart.html  and at:  http://www.openldap.org/faq/data/cache/172.html  These are links to the openldap quick start guide.  You really should think about picking up a good LDAP book, it would help you out in your task immensely.  Personally, I like the Mark Wilcox book:  Implementing LDAP published by WROX.  I think it runs about US $40.  This covers a pretty broad area of LDAP topics from the C API, to PerLDAP, to installing and LDAP server.

I hope that this helps.  Anyone feel free to correct me if I am wrong about any of this.

Daniell Freed

srihari parimi wrote:

Hi Mr Daniell

Thanks for the quick response. I am taking liberty to trouble you
a bit more on this subject. My requirements are :

We are developing an application which requires to LDAP database.
Since I am familiar with SQL, I shall put the problem in terms of
SQL. The database should basically contain a table ( for LDAP , I
guess that is an object class ) which has say 5 fields ( attributes )
like mail-id, IP Address, Telephone number. extn number, location.

As per my understanding, correct me if I am wrong, I must add that
object class in the slapd.oc.conf and define the attribute syntax
in the file slapd.at.conf ??

Also how should I populate the database ?? How should I retrieve
information ?? How should I modify the database ??

You may assume that the linux machine that I am using is independent
and that I am starting SLDAP ( that is I have just installled OpenLDAP )

Initially I would be using commands such as ldapadd, etc but later
I intend to use LDAP APIs

Also do you know of any web-site where I can find examples of these
configuration files etc.

Thanks in advance

Daniell Freed wrote:
> New object classes are defined in the file slapd.oc.conf.  New attributes
> are defined in slapd.at.conf.
> If you installed from an RPM (at least on RedHat and Mandrake) these files
> are located in /etc/openldap.  Once the changes are made, you need to
> restart your ldap server.
> Daniell Freed
> Computer Services
> Dewitt, Ross, & Stevens

Daniell Freed
Computer Services
Dewitt, Ross, & Stevens S.C.

He who fights with monsters might take care 
lest he thereby become a monster. 
And if you gaze for long into an abyss, 
the abyss gazes also into you.

Beyond Good and Evil
Friedrich Wilhelm Nietzche