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

Re: grrr...why won't this work?



> Hi all,
> 
> Thanks for the ideas on some tutorial web sites and articles. Many of them were
> very helpful in clearing up some fundamental concepts for me.
> 
> Still, though, I can't actually get my OpenLdap install to do anything. Most
> recently, I followed a tutorial on getting OpenLDAP set up on Linux, word for
> word, but it did not produce the expected results. Here's what I did. If anyone
> can tell me what I'm doing wrong, I'd really appreciate it.
> 
> After successful installation, I modified the slapd.conf as such: (straight
> from the tutorial) :
> #
> # See slapd.conf(5) for details on configuration options.
> # This file should NOT be world readable.
> #
> include		/etc/openldap/slapd.at.conf
> include		/etc/openldap/slapd.oc.conf
> schemacheck	off
> #referral	ldap://root.openldap.org/
> 
> pidfile		/var/run/slapd.pid
> argsfile	/var/run/slapd.args
> 
> #######################################################################
> # ldbm database definitions
> #######################################################################
> 
> database	ldbm
> suffix		"o=Lerdorf, c=CA"
> rootdn		"cn=root, o=Lerdorf, c=CA"
> rootpw		secret
> directory	/var/lib/ldap
> 
> So, to my present understanding, this file defines a "database" that handles
> all the data input with a suffix of "o=Lerdorf, c=CA". Is that correct? The
> tutorial goes on to tell me to create an ldif file that looks like this:
> 
> dn: o=Lerdorf, c=CA 
> o: Lerdorf 
> objectclass: organization 
> 
> dn: ou=Friends, o=Lerdorf, c=CA 
> ou: Friends objectclass: organizationalunit 
> 
> dn: ou=Colleagues, o=Lerdorf, c=CA 
> ou: Colleagues 
> objectclass: organizationalunit 
> 
> dn: ou=Misc, o=Lerdorf, c=CA 
> ou: Misc 
> objectclass: organizationalunit 
> 
> dn: cn=Rasmus Lerdorf, ou=Friends, o=Lerdorf, c=CA 
> cn: Rasmus Lerdorf 
> sn: Lerdorf 
> mail: rasmus@lerdorf.on.ca 
> mail: rasmus@php.net 
> objectclass: person 
> 
> dn: cn=John Doe, ou=Misc, o=Lerdorf, c=CA 
> cn: John Doe 
> sn: Doe 
> mail: test@address.com 
> objectclass: person 
> 
> OK, so all of these entries have the suffix "o=Lerdorf, c=CA", so they'll be
> handled by the database defined in my slapd.conf, right? The next thing it says
> to do is use ldif2ldbm. Other books I have say to use ldapadd. What is the
> difference between these commands? ie why use one over the other to populate
> the database? Following the tutorial, I enter the following command which seems
> to execute successfully (test.ldif is the above file):
> 
> /usr/local/sbin/ldif2ldbm -i test.ldif -f /usr/local/etc/ldap/slapd.conf
> 
> Now the tutorial says to start the server this way:
> 
> slapd -f /usr/local/etc/ldap/slapd.conf 
> 
> When I run a ps -ax | grep slapd, there are 3 processes shown, so I guess it's
> running. Safe assumption? Finally, the tutorial says to run a wildcard search
> against the server using this command:
> 
> ldapsearch objectclass=\* 
> 
> When I run this command, I get an "No such object" error. I feel like I've been
> trying to get this to work forever in a million different ways. Can anyone see a
> fatal flaw here? Is there somewhere I can look to get a better picture of whats
> going wrong? I must have ldap! Thanks for any help anyone can offer.
> 
> Gregg
> 


Try 
	ldapsearch -b  "o=Lerdorf, c=CA" objectclass=\*

If it works, it means you just didn't configure your ldap.conf file,
which should be found in the same directory as slapd.conf.  A "No such object"
error in an ldapsearch just about always means the base of the search does
not exist.