Hi, I am writing because some time ago I have done some things with LDAP. But I am unable to make the new versions work (2.4.x). Basically I create the config file but I am unable to say to LDAP to use it instead of the default one. Is that clear somewhere in the documentation? can anyone help me?
I have followed the official documentation and I managed to compile and create the config files (Config manual http://www.openldap.org/doc/admin24/slapdconf2.html), after this I have an ldif file like this: root@helpDesk10000:~# cat base.ldif # example config file - global configuration entry dn: cn=config objectClass: olcGlobal cn: config # olcReferral: ldap://root.openldap.org
# internal schema dn: cn=schema,cn=config objectClass: olcSchemaConfig cn: schema
# include the core schema include: file:///usr/local/etc/openldap/schema/core.ldif http:///usr/local/etc/openldap/schema/core.ldif%3C/p%3E%3Cp%3E# http:///usr/local/etc/openldap/schema/core.ldif%3C/p%3E%3Cp%3E#
# http:///usr/local/etc/openldap/schema/core.ldif%3C/p%3E%3Cp%3E# global database parameters dn: olcDatabase=frontend,cn=config objectClass: olcDatabaseConfig olcDatabase: frontend olcAccess: to * by * read
# set a rootpw for the config database so we can bind. # deny access to everyone else. dn: olcDatabase=config,cn=config objectClass: olcDatabaseConfig olcDatabase: config olcRootPW: {SSHA}EQpw7T2x2Num+krwRjq/ZYczmRgaX1Km olcAccess: to * by * none
# HDB definition for example.com dn: olcDatabase=bdb,cn=config objectClass: olcDatabaseConfig objectClass: olcHdbConfig olcDatabase: hdb olcSuffix: dc=helpdesk,dc=co,dc=bw olcDbDirectory: /var/lib/ldap-database olcRootDN: cn=Manager,dc=helpdesk,dc=co,dc=bw olcRootPW: {SSHA}teY3/6WO7uoGrCmaDu9NKmvgn87WlCCw olcDbIndex: uid pres,eq olcDbIndex: cn,sn pres,eq,approx,sub olcDbIndex: objectClass eq olcAccess: to attrs=userPassword by self write by anonymous auth by dn.base="cn=Admin,dc=helpdesk,dc=co,dc=bw" write by * none olcAccess: to * by self write by dn.base="cn=Admin,dc=helpdesk,dc=co,dc=bw" write by * read root@helpDesk10000:~#
Then the LDAP add apparently works: root@helpDesk10000:~# ldapadd -Y EXTERNAL -H ldapi:/// -vn -f base.ldif add objectClass: olcGlobal add cn: config !adding new entry "cn=config"
add objectClass: olcSchemaConfig add cn: schema !adding new entry "cn=schema,cn=config"
add objectClass: olcSchemaConfig add cn: core add olcAttributeTypes: ( 2.5.4.2 NAME 'knowledgeInformation' DESC 'RFC2256: knowledge information' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} ) ( 2.5.4.4 NAME
(...)
add olcDbDirectory: /var/lib/ldap-database add olcRootDN: cn=Manager,dc=helpdesk,dc=co,dc=bw add olcRootPW: {SSHA}teY3/6WO7uoGrCmaDu9NKmvgn87WlCCw add olcDbIndex: uid pres,eq cn,sn pres,eq,approx,sub objectClass eq add olcAccess: to attrs=userPassword by self write by anonymous auth by dn.base="cn=Admin,dc=helpdesk,dc=co,dc=bw" write by * none to * by self write by dn.base="cn=Admin,dc=helpdesk,dc=co,dc=bw" write by * read !adding new entry "olcDatabase=bdb,cn=config"
root@helpDesk10000:~#
after that I start slapcat and it says this:
root@helpDesk10000:~# slapcat 545b828d bdb_db_open: warning - no DB_CONFIG file found in directory /usr/local/var/openldap-data: (2). Expect poor performance for suffix "dc=my-domain,dc=com". 545b828d bdb_monitor_db_open: monitoring disabled; configure monitor database to enable root@helpDesk10000:~#
*How do I say to LDAP to use my configuration instead of the default one?*
Thank you!
Abel Guzmán Sánchez wrote:
Hi, I am writing because some time ago I have done some things with LDAP. But I am unable to make the new versions work (2.4.x). Basically I create the config file but I am unable to say to LDAP to use it instead of the default one.
You're looking for slapd command-line options -f or -F.
-f for static configuration file -F directory when using back-config
Is that clear somewhere in the documentation?
Yes:
http://www.openldap.org/software/man.cgi?query=slapd&apropos=0&sekti...
Ciao, Michael.
openldap-technical@openldap.org