Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
LDAP works fine for me with the schemas provided, but for simplicity's sake I created a custom schema to fit my particular needs.
I created the following schema in the /usr/local/etc/openldap/schema directory:
#####################################################################
# employee.schema -- Employee
# Basic schema to handle only necessary attributes and classes
# name
# This is the common name of an individual, ex: John Doe
attributetype ( 1.1.2.1.1
NAME 'name'
DESC 'common name'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
# email
# This is the individual's email address
attributetype ( 1.1.2.1.2
NAME 'email'
DESC 'primary email'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
# office
# This is the room number of the individual's office
attributetype ( 1.1.2.1.3
NAME 'office'
DESC 'office room number'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
# officePhone
# This is the office telephone number
attributetype ( 1.1.2.1.4
NAME 'officePhone'
DESC 'office phone number'
EQUALITY telephoneNumberMatch
SUBSTR telephoneNumberSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{32} )
# cellPhone
# Individual's cell number if necessary or applicable
attributetype ( 1.1.2.1.5
NAME 'cellPhone'
DESC 'cell phone number'
EQUALITY telephoneNumberMatch
SUBSTR telephoneNumberSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{32} )
# employee
# All personnel of eos
objectclass ( 1.1.2.2.3
NAME 'employee'
SUP top
STRUCTURAL
MUST ( name $ email )
MAY ( office $ officePhone $ cellPhone )
)
#####################################################################
I added the following line to the slapd.conf file:
include /usr/local/etc/openldap/schema/employee.schema
I seemed to have issues doing that. I tried /etc/rc.d/init.d/slapd restart but slapd doesn't seem to be in that directory for some reason. I'm sure there must be some other way to restart it. Any ideas?
In many cases, though the server is called slapd, the actual service command is ldap, so you could try /etc/init.d/ldap restart or service ldap restart
In /etc/openldap/slapd.conf, set loglevel to 256
Then, in a terminal, run sudo tail -f /var/log/messages
In another terminal run sudo service ldap start and switch back to the other term to see the messages.
I see a slapd.conf in /etc/openldap/ but I've been editing the one in /usr/local/etc/openldap/. Is that bad? When I add the line loglevel = 256 to that file and tail the logs and run /sbin/service ldap start nothing shows in the logs but I now get this message:
Checking configuration files for slapd: [FAILED]
could not stat config file "/etc/openldap/schema/employee.schema": No such file or directory (2)
slaptest: bad configuration file!
I moved everything over to /etc/openldap/ and edited that slapd.conf file. Now when I try to restart slapd I get this error:
/etc/openldap/slapd.conf: line 90: <suffix> invalid DN 21 (Invalid syntax)
slaptest: bad configuration file!
I checked my slapd.conf and my suffix is the same as it was before in my other conf file. I don't know what's wrong. This is starting to drive me crazy!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.