目錄表

CentOS 5 安裝 OpenLdap 管理通訊錄

- 安裝套件

- 設定 LDAP Server

[root@pd920 ~]# slappasswd
New password:
Re-enter new password:
{SSHA}N3Xr7mUajfh9BY_________xx_WfWgb
:
suffix          "dc=ichiayi,dc=com"
rootdn          "cn=Manager,dc=ichiayi,dc=com"
:
rootpw          {SSHA}N3Xr7mUajfh9BY_________xx_WfWgb
:

- 建立 LDAP 內組織結構

cd /etc/openldap
cp DB_CONFIG.example /var/lib/ldap/DB_CONFIG

root_unit.ldif

slapadd -v -l root_unit.ldif
----
[root@pd920 openldap]# slapadd -v -l /tmp/root_unit.ldif
added: "dc=ichiayi,dc=com" (00000001)
added: "ou=login,dc=ichiayi,dc=com" (00000002)
added: "ou=user,ou=login,dc=ichiayi,dc=com" (00000003)
added: "ou=group,ou=login,dc=ichiayi,dc=com" (00000004)
added: "ou=company,dc=ichiayi,dc=com" (00000005)
added: "ou=unit,ou=company,dc=ichiayi,dc=com" (00000006)
added: "ou=hr,ou=unit,ou=company,dc=ichiayi,dc=com" (00000007)
added: "ou=mis,ou=unit,ou=company,dc=ichiayi,dc=com" (00000008)
added: "ou=tech,ou=unit,ou=company,dc=ichiayi,dc=com" (00000009)
added: "ou=customer,ou=company,dc=ichiayi,dc=com" (0000000a)
----
chown -R ldap /var/lib/ldap/*

- 啟動 LDAP Server 與確認匯入資料正確

實際過程

- 安裝 LDAP Web 管理介面系統 GOsa (尚未完成)

實際安裝過程

- 匯入現有 Thunderbird 通訊錄資料(尚未完成)

[root@pd920 tmp]# slapadd -v -l jonathan.ldif

bdb_db_open: Warning - No DB_CONFIG file found in directory /var/lib/ldap: (2)
Expect poor performance for suffix dc=ichiayi,dc=com.
<= str2entry: str2ad(mozillaNickname): attribute type undefined
slapadd: could not parse entry (line=742)
[root@pd920 tmp]#

[root@pd920 openldap]# service ldap start
正在為 slapd 檢查設定檔案:  config file testing succeeded
                                                           [  確定  ]
正在啟動 slapd:                                            [  確定  ]
[root@pd920 openldap]#

- 參考資料