差異處
這裏顯示兩個版本的差異處。
兩邊的前次修訂版 前次修改 下次修改 | 前次修改 | ||
tech:openldap [2007/10/25 18:32] – jonathan | tech:openldap [2009/06/05 07:18] (目前版本) – jonathan | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | ====== CentOS 5 安裝 OpenLdap 管理通訊錄 ====== | ||
+ | ===== - 安裝套件 ===== | ||
+ | * compat-openldap-2.3.27_2.2.29-5 | ||
+ | * openldap-2.3.27-5 | ||
+ | * openldap-devel-2.3.27-5 | ||
+ | * openldap-clients-2.3.27-5 | ||
+ | * openldap-servers-2.3.27-5 | ||
+ | * openldap-servers-sql-2.3.27-5 | ||
+ | |||
+ | ===== - 設定 LDAP Server ===== | ||
+ | * 透過 slappasswd 產生主要的密碼 | ||
+ | < | ||
+ | [root@pd920 ~]# slappasswd | ||
+ | New password: | ||
+ | Re-enter new password: | ||
+ | {SSHA}N3Xr7mUajfh9BY_________xx_WfWgb | ||
+ | </ | ||
+ | * vi / | ||
+ | < | ||
+ | : | ||
+ | suffix | ||
+ | rootdn | ||
+ | : | ||
+ | rootpw | ||
+ | : | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== - 建立 LDAP 內組織結構 ===== | ||
+ | * 將 DB_CONFIG.example -> / | ||
+ | < | ||
+ | cd / | ||
+ | cp DB_CONFIG.example / | ||
+ | </ | ||
+ | |||
+ | * 編輯與匯入組織結構檔 | ||
+ | ++++root_unit.ldif| | ||
+ | < | ||
+ | # root node | ||
+ | dn: dc=ichiayi, | ||
+ | dc: ichiayi | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | ou: ichiayi Dot com | ||
+ | |||
+ | #login top | ||
+ | dn: ou=login, | ||
+ | ou: login | ||
+ | objectClass: | ||
+ | |||
+ | #user, uid, password | ||
+ | dn: ou=user, | ||
+ | ou: user | ||
+ | objectClass: | ||
+ | |||
+ | #group | ||
+ | dn: ou=group, | ||
+ | ou: group | ||
+ | objectClass: | ||
+ | |||
+ | ##for company organization top | ||
+ | dn: ou=company, | ||
+ | ou: company | ||
+ | objectClass: | ||
+ | |||
+ | #for company organization (unit) | ||
+ | dn: ou=unit, | ||
+ | ou: unit | ||
+ | objectClass: | ||
+ | |||
+ | #human resource (under unit) | ||
+ | dn: ou=hr, | ||
+ | ou: hr | ||
+ | objectClass: | ||
+ | |||
+ | #MIS (under unit) | ||
+ | dn: ou=mis, | ||
+ | ou: mis | ||
+ | objectClass: | ||
+ | |||
+ | #Tech (under unit) | ||
+ | dn: ou=tech, | ||
+ | ou: tech | ||
+ | objectClass: | ||
+ | |||
+ | # for customers information | ||
+ | dn: ou=customer, | ||
+ | ou: customer | ||
+ | objectClass: | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | < | ||
+ | slapadd -v -l root_unit.ldif | ||
+ | ---- | ||
+ | [root@pd920 openldap]# slapadd -v -l / | ||
+ | added: " | ||
+ | added: " | ||
+ | added: " | ||
+ | added: " | ||
+ | added: " | ||
+ | added: " | ||
+ | added: " | ||
+ | added: " | ||
+ | added: " | ||
+ | added: " | ||
+ | ---- | ||
+ | chown -R ldap / | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== - 啟動 LDAP Server 與確認匯入資料正確 ===== | ||
+ | * service ldap start | ||
+ | * ldapsearch -x -b " | ||
+ | ++++實際過程| | ||
+ | < | ||
+ | [root@pd920 openldap]# service ldap start | ||
+ | 正在為 slapd 檢查設定檔案: | ||
+ | | ||
+ | 正在啟動 slapd: | ||
+ | [root@pd920 openldap]# ldapsearch -x -b " | ||
+ | # extended LDIF | ||
+ | # | ||
+ | # LDAPv3 | ||
+ | # base < | ||
+ | # filter: (objectclass=*) | ||
+ | # requesting: ALL | ||
+ | # | ||
+ | |||
+ | # ichiayi.com | ||
+ | dn: dc=ichiayi, | ||
+ | dc: ichiayi | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | ou: ichiayi Dot com | ||
+ | |||
+ | # login, ichiayi.com | ||
+ | dn: ou=login, | ||
+ | ou: login | ||
+ | objectClass: | ||
+ | |||
+ | # user, login, ichiayi.com | ||
+ | dn: ou=user, | ||
+ | ou: user | ||
+ | objectClass: | ||
+ | |||
+ | # group, login, ichiayi.com | ||
+ | dn: ou=group, | ||
+ | ou: group | ||
+ | objectClass: | ||
+ | |||
+ | # company, ichiayi.com | ||
+ | dn: ou=company, | ||
+ | ou: company | ||
+ | objectClass: | ||
+ | |||
+ | # unit, company, ichiayi.com | ||
+ | dn: ou=unit, | ||
+ | ou: unit | ||
+ | objectClass: | ||
+ | |||
+ | # hr, unit, company, ichiayi.com | ||
+ | dn: ou=hr, | ||
+ | ou: hr | ||
+ | objectClass: | ||
+ | |||
+ | # mis, unit, company, ichiayi.com | ||
+ | dn: ou=mis, | ||
+ | ou: mis | ||
+ | objectClass: | ||
+ | |||
+ | # tech, unit, company, ichiayi.com | ||
+ | dn: ou=tech, | ||
+ | ou: tech | ||
+ | objectClass: | ||
+ | |||
+ | # customer, company, ichiayi.com | ||
+ | dn: ou=customer, | ||
+ | ou: customer | ||
+ | objectClass: | ||
+ | |||
+ | # search result | ||
+ | search: 2 | ||
+ | result: 0 Success | ||
+ | |||
+ | # numResponses: | ||
+ | # numEntries: 10 | ||
+ | [root@pd920 openldap]# | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | |||
+ | ===== - 安裝 LDAP Web 管理介面系統 GOsa (尚未完成)===== | ||
+ | |||
+ | * GOsa 網站 : http:// | ||
+ | ++++實際安裝過程| | ||
+ | < | ||
+ | cd /usr/share/ | ||
+ | wget ftp:// | ||
+ | tar -zxvf gosa-2.5.13.tar.gz | ||
+ | mv gosa-2.5.13 gosa | ||
+ | rm gosa-2.5.13.tar.gz | ||
+ | cd gosa | ||
+ | mkdir / | ||
+ | chmod 777 / | ||
+ | mkdir /etc/gosa | ||
+ | |||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | ===== - 匯入現有 Thunderbird 通訊錄資料(尚未完成) ===== | ||
+ | * 將通訊錄資料會出成 jonathan.ldif | ||
+ | * 使用 slapadd -v -l jonathan.ldif 匯入 | ||
+ | < | ||
+ | [root@pd920 tmp]# slapadd -v -l jonathan.ldif | ||
+ | |||
+ | bdb_db_open: | ||
+ | Expect poor performance for suffix dc=ichiayi, | ||
+ | <= str2entry: str2ad(mozillaNickname): | ||
+ | slapadd: could not parse entry (line=742) | ||
+ | [root@pd920 tmp]# | ||
+ | |||
+ | [root@pd920 openldap]# service ldap start | ||
+ | 正在為 slapd 檢查設定檔案: | ||
+ | | ||
+ | 正在啟動 slapd: | ||
+ | [root@pd920 openldap]# | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== - 參考資料 ===== | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | {{tag> |