歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> 更多Linux >> openldap在Redhat 8.0下的安裝和配置筆記

openldap在Redhat 8.0下的安裝和配置筆記

日期:2017/2/27 14:21:57   编辑:更多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了。 不好意思啊,我想問問那個設置slapd.conf時 suffix “dc=buct, dc=edu.cn” rootdn “cn=root, dc=buct, dc=edu.cn” dc填什麼啊?表示啥意思?我應該怎麼填呢? 還有你是如下設置,我應該設置什麼東西啊,呵呵,不好意思,我很弱诶 /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


沒關系,大家一起學習嘛! suffix “dc=buct, dc=edu.cn” rootdn “cn=root, dc=buct, dc=edu.cn” 是定義你的ldap的搜索路徑,dc方式是以域名方式來定義,另外還有o=(組織),c=(區域)的方式,你多看看相關的資料,這些是構建ldap服務器數據的基礎,應該好好掌握。 /etc/hosts : 127.0.0.1 localhost.localdomain localhost (這是Linux下默認的主機地址,應該相同) 202.xxx.xxx.xxx buct.edu.cn (這裡是你的ldap服務器的ip地址,以及你定義的基准路徑) /etc/openldap/ldap.conf: HOST 202.xxx.xxx.xxx (ldap服務器的ip地址) BASE dc=buct , dc=edu.cn hoho,謝謝你了,我可能是因為安裝時的問題 一開始我反復領悟並貫徹各種資料精神,但是啟動老是不成功,無可奈何之下刪了重裝,就好了,謝謝你呀icon_smile.gif



Copyright © Linux教程網 All Rights Reserved