歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> 更多Linux >> openldap的配置手冊

openldap的配置手冊

日期:2017/2/27 14:20:21   编辑:更多Linux
  最近一直在安裝opneldap-2.0.25,現在終於搞定了,所以拿來和大家分享一下,如果有什麼意見,可以共同討論一下: 1) 一般需要安裝以下四個rpm包: openldap-2.0.25-1.i386.rpm openldap-servers-2.0.25-1.i386.rpm openldap-clients-2.0.25-1.i386.rpm openldap-devel -2.0.25-1.i386.rpm Openldap-2.0*是必要套件,一定要先安裝;Openldap-servers*是服務器套件;openldap-clients*是操作程序套件;openldap-devel*是開發工具套件. 如果需要用ldap做一些高級應用,還需要加裝如下套件: auth_ldap* nss_ldap* PHP_ldap* 2)下一步就是配置了 配置文件一般在/etc/openldap/下: ldapfilter.conf ldap.conf ldapsearchprefs.conf schema ldaptemplates.conf slapd.conf 文件slapd.conf是設置ldap服務器連接,進入文件,修改相應的部分: 在include /etc/openldap/schema/…… 部分添加完整的方案,即schema目錄下的所有方案。 在“ldbm database definitions”部分,用suffix命令設置ldap服務器的基礎搜索路徑(BDN): suffix “dc=bUCt, dc=edu.cn” rootdn “cn=root, dc=buct, dc=edu.cn” rootpw 123456 其它大多數的缺省設置都是適當的。 然後檢查兩個文件,以保證可以在同一台機器上實現服務器與客戶端同機操作: /etc/hosts : 127.0.0.1 localhost.localdomain localhost 202.xxx.xxx.xxx buct.edu.cn /etc/openldap/ldap.conf: HOST 202.4.155.91 BASE dc=buct , dc=edu.cn 3)測試服務器: #service ldap start #ldapsearch –x –b ‘’ -s base ‘(objectclass=*)’ namingContexts 如果正確配置了,應該出現下面輸出: version :2 #filter(objectclass=*) #requesting: namingContexts dn: namingContexts: dc=buct, dc=edu.cn #search result search :2 result :0 success # numResponses: 2 # numEntries: 1 如果出現錯誤消息,則返回並檢查配置。 4)最後一步是設置一些基本的訪問控制,Redhat 將ACL添加到slapd.conf文件裡: #define ACLs ……Access control definitions access to dn=“.* , dc=buct, dc=edu.cn” attr=passWord by dn=“cn=root, dc=buct, dc=edu.cn” write by self write by * read access to dn=“.* , dc=buct, dc=edu.cn” by * read 最後在重起一下ldap服務器,就ok了。




Copyright © Linux教程網 All Rights Reserved