日期:2014-05-16  浏览次数:20540 次

LDAP-Series-1-Chapter-2

Config LDAP.

  1. Directory struct.
|-- bin(ldap tool)
|   |-- ldapadd -> ldapmodify
|   |-- ldapcompare
|   |-- ldapdelete
|   |-- ldapexop
|   |-- ldapmodify
|   |-- ldapmodrdn
|   |-- ldappasswd
|   |-- ldapsearch
|   |-- ldapurl
|   `-- ldapwhoami
|-- etc(config file)
|   `-- openldap
|-- include
|   |-- lber.h
|   |-- lber_types.h
|   |-- ldap_cdefs.h
|   |-- ldap_features.h
|   |-- ldap.h
|   |-- ldap_schema.h
|   |-- ldap_utf8.h
|   |-- ldif.h
|   `-- slapi-plugin.h
|-- LDIF(make by myself)
|   |-- init.ldif
|   `-- modify.ldif
|-- lib
|   |-- liblber-2.4.so.2 -> liblber-2.4.so.2.8.4
|   |-- liblber-2.4.so.2.8.4
|   |-- liblber.a
|   |-- liblber.la
|   |-- liblber.so -> liblber-2.4.so.2.8.4
|   |-- libldap-2.4.so.2 -> libldap-2.4.so.2.8.4
|   |-- libldap-2.4.so.2.8.4
|   |-- libldap.a
|   |-- libldap.la
|   |-- libldap_r-2.4.so.2 -> libldap_r-2.4.so.2.8.4
|   |-- libldap_r-2.4.so.2.8.4
|   |-- libldap_r.a
|   |-- libldap_r.la
|   |-- libldap_r.so -> libldap_r-2.4.so.2.8.4
|   `-- libldap.so -> libldap-2.4.so.2.8.4
|-- libexec
|   `-- slapd(start ldap)
|-- PHP_LDAP(Make by myself)
|   |-- action.php
|   |-- ldap.php
|   `-- m_ldap.php
|-- sbin
|   |-- killslap.sh (write to kill slapd)
|   |-- slapacl -> ../libexec/slapd
|   |-- slapadd -> ../libexec/slapd
|   |-- slapauth -> ../libexec/slapd
|   |-- slapcat -> ../libexec/slapd
|   |-- slapdn -> ../libexec/slapd
|   |-- slapindex -> ../libexec/slapd
|   |-- slappasswd -> ../libexec/slapd
|   |-- slapschema -> ../libexec/slapd
|   `-- slaptest -> ../libexec/slapd
|-- share
|   `-- man
`-- var
    |-- openldap-data
    |-- run
    `-- weiwejiaLdap(make to store my ldap)
  1. The structure is clear now.
  2. Go into openldap/etc/openldap(structure like blow)
|-- ACL.conf(make by myself to contain ACL config)
|-- DB_CONFIG.example
|-- ldap.conf
|-- ldap.conf.default
|-- schema
|-- slapd.conf
|-- slapd.conf.bck
|-- slapd.conf.default
|-- slapd.ldif
`-- slapd.ldif.default
  1. First, you should vi slapd.conf
  2. include         /usr/local/openldap/etc/openldap/schema/core.schema
    include         /usr/local/openldap/etc/openldap/schema/cosine.schema
    include         /usr/local/openldap/etc/openldap/schema/inetorgperson.schema (inetorgperson)
    include         /usr/local/openldap/etc/openldap/schema/nis.schema (posixaccount,posixgroup)     All above is schema.
  3. include         /usr/local/openldap/etc/openldap/ACL.conf   (ACL file)
  4. database        bdb
    suffix          "dc=xxx,dc=org"
    rootdn          "cn=admin,dc=xxx,dc=org"
    directory       /usr/local/openldap/var/weiwejiaLdap  (dir to contain the ldap)
OK, the dn of super root is "cn=admin,dc=xxx,dc=org" now. Password set as rootpw, Using slappasswd to generate.