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

Setting up OpenLDAP



Hi,
I have installed OpenLDAP but I cannot load my schema. My slapd.conf file  is as follows:

#-------------------------------
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.

include         /usr/local/etc/openldap/slapd.at.conf
include         /usr/local/etc/openldap/slapd.oc.conf
schemacheck     on
#referral       ldap://ldap.itd.umich.edu

pidfile         /usr/local/var/slapd.pid
argsfile        /usr/local/var/slapd.args

#######################################################################
# ldbm database definitions
#######################################################################

database        ldbm
suffix          "o=office.co.in"
directory       /usr/tmp/ldap-data
rootdn          "cn=directory manager, o=office.co.in"
rootpw          secret
#-----------------------------

I have a file called Attribs.ldif which contains the attributes I want to add to the schema. The file is as below:
#-----------------------------
dn: cn=schema
changetype:  add
add: attributesTypes
attributeTypes: ( 2.16.840.1.113793.4.0.1.200 NAME 'officecompanycountry' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )
attributeTypes: ( 2.16.840.1.113793.4.0.1.201 NAME 'officecompanytitle' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )
attributeTypes: ( 2.16.840.1.113793.4.0.1.202 NAME 'officecompanydepartment' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )
                                  .
                                  .
#-----------------------------

When I give the command:
./ldapadd -v -D "cn=directory manager,o=office.co.in" -w secret
  -h localhost -p 389 -f Attribs.ldif

I get:
<list of all entries in the file>
adding entry cn=schema
ldap_modify: No such object

SECOND DOUBT:
I read on the OpenLDAP site that the attributes and the object classes can be added to the schema by putting it in the slapd.conf. I changed my  slapd.conf file looks like this :
#----------------------------
attribute officecompanycountry cis
attribute officecompanytitle cis
attribute officecompanydepartment cis
attribute officeuserid cis
                            .
                            .
objectclass preferencespersonal
requires objectclass
allows officemsghdrsperpage, officemsgsortorder, officemsglinewidth, officememberofoffices, officememberofgroups, officepreviewwindow, officemsg3lines, officenewonurl, officenewoncompose, officeconfirmaftersend, officesaveaddress, officefolderheaders, officefoldersortby
                           .
                           .
include         /usr/local/etc/openldap/slapd.at.conf
include         /usr/local/etc/openldap/slapd.oc.conf

schemacheck     on
#referral       ldap://ldap.itd.umich.edu

pidfile         /usr/local/var/slapd.pid
argsfile        /usr/local/var/slapd.args
<rest is same as the above slapd.conf file>
#---------------------------------

Now when I start slapd with -d 1, I get the following message:
"/usr/local/etc/openldap/slapd.conf: line 144: unknown directive "requires" outside database definition (ignored)"
                                           .
                                           .
<same for all the objext class definitions made in slapd.conf>
#----------------------------------

What could be the problem?
How do add my own attributes to the schema?
How do I add my Objectclasses to the schema?

Thanks,
Vineet.