免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6816 | 回复: 9
打印 上一主题 下一主题

[ldap] openldap 2.4版的如何配置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-01-19 15:49 |只看该作者 |倒序浏览
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
24
天蝎座
日期:2014-05-13 18:05:59IT运维版块每日发帖之星
日期:2015-11-26 06:20:00操作系统版块每月发帖之星
日期:2015-12-02 14:57:54IT运维版块每月发帖之星
日期:2016-01-07 23:01:56IT运维版块每周发帖之星
日期:2016-01-07 23:04:2615-16赛季CBA联赛之青岛
日期:2016-01-23 07:58:272016猴年福章徽章
日期:2016-02-18 15:30:3415-16赛季CBA联赛之北控
日期:2016-03-23 14:20:06IT运维版块每日发帖之星
日期:2016-04-01 06:20:0015-16赛季CBA联赛之吉林
日期:2016-06-28 13:51:54IT运维版块每日发帖之星
日期:2016-07-01 06:20:00IT运维版块每日发帖之星
日期:2015-11-23 06:20:00
2 [报告]
发表于 2015-01-19 16:44 |只看该作者
一个模板文件,自己创建一个slapd.conf和把slapd.d修改成slapd.conf有撒区别,小伙你钻死角了。
还有谁告诉你的最新版是用slapd.d做模板配置,我编译过官网最新版的openldap,别人直接提供的就是slapd.conf这个配置文件,从来就没改动过。


以下就是官网最新版openldap2.4版的默认主配置文件,我没做任何改动。什么yum安装还是rpm安装,里面的配置文件都是按照各自第三方软件厂商进行修改过的,不要被误导,openldap官网才是权威。

# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include         /usr/local/etc/openldap/schema/core.schema

# Define global ACLs to disable default read access.

# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral       ldap://root.openldap.org

pidfile         /usr/local/var/run/slapd.pid
argsfile        /usr/local/var/run/slapd.args

# Load dynamic backend modules:
# modulepath    /usr/local/libexec/openldap
# moduleload    back_bdb.la
# moduleload    back_hdb.la
# moduleload    back_ldap.la

# Sample security restrictions
#       Require integrity protection (prevent hijacking)
#       Require 112-bit (3DES or better) encryption for updates
#       Require 63-bit encryption for simple bind
# security ssf=1 update_ssf=112 simple_bind=64

# Sample access control policy:
#       Root DSE: allow anyone to read it
#       Subschema (sub)entry DSE: allow anyone to read it
#       Other DSEs:
#               Allow self write access
#               Allow authenticated users read access
#               Allow anonymous users to authenticate
#       Directives needed to implement policy:
# access to dn.base="" by * read
# access to dn.base="cn=Subschema" by * read
# access to *
#       by self write
#       by users read
#       by anonymous auth
#
# if no access controls are present, the default policy
# allows anyone and everyone to read anything but restricts
# updates to rootdn.  (e.g., "access to * by * read"
#
# rootdn can always read and write EVERYTHING!

#######################################################################
# BDB database definitions
#######################################################################

database        bdb
suffix          "dc=my-domain,dc=com"
rootdn          "cn=Manager,dc=my-domain,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoid.  See slappasswd( and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw          secret
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory       /usr/local/var/openldap-data
# Indices to maintain
index   objectClass     eq


小提示 这个是我一年前到官网找的最新版做测试,因为我需要他的多主多从冗余功能,很可能现在有比这个更新的版本,但换汤不换药。
opendlap2.4.35编译安装默認就以bdb數據庫來安裝,不安裝bdb就會出錯,即使按照參數當中取消安裝bdb,還是會報錯,默認已不再支持ldbm。
安裝完成后,要加入schema文件,默認他只include(包含)一個。
include      /usr/local/etc/openldap/schema/core.schema     (包含) 官网提供的slapd.conf预设只提供这一个模板。
include      /usr/local/etc/openldap/schema/cosine.schema    (自己添加)
include      /usr/local/etc/openldap/schema/inetorgperson.schema(自己添加)
include     /usr/local/etc/openldap/schema/nis.schema(自己添加)
如不加後面三個schema文件,你添加objectclass 當中的top類和domain類就會報錯提示無效的值。所以當你導入老數據到新的數據出錯時,不要聽網上很多錯誤答案說什麽版本問題,其實就是新版的openldap或者可以確切說編譯的openldap(可以稱為數據庫模板)沒有包含一些舊的schema文件

论坛徽章:
0
3 [报告]
发表于 2015-01-20 09:36 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
4 [报告]
发表于 2015-01-21 10:52 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
24
天蝎座
日期:2014-05-13 18:05:59IT运维版块每日发帖之星
日期:2015-11-26 06:20:00操作系统版块每月发帖之星
日期:2015-12-02 14:57:54IT运维版块每月发帖之星
日期:2016-01-07 23:01:56IT运维版块每周发帖之星
日期:2016-01-07 23:04:2615-16赛季CBA联赛之青岛
日期:2016-01-23 07:58:272016猴年福章徽章
日期:2016-02-18 15:30:3415-16赛季CBA联赛之北控
日期:2016-03-23 14:20:06IT运维版块每日发帖之星
日期:2016-04-01 06:20:0015-16赛季CBA联赛之吉林
日期:2016-06-28 13:51:54IT运维版块每日发帖之星
日期:2016-07-01 06:20:00IT运维版块每日发帖之星
日期:2015-11-23 06:20:00
5 [报告]
发表于 2015-01-22 09:39 |只看该作者
回复 4# chenzhiquan2000

你测试这个openldap用来做什么用途的?
你要结合ssl和openldap一起使用,是做openldap主从同步服務器之間互相複製数据时,使用TLS連接了,还是客戶端使用或更改openldap數據時使用TLS連接。


配置ssl过程比较复杂,你要说明你的用在哪方面,我才好给你方向。但无论怎样你得分以下步骤进行
第一:配置openssl
第二:配置openldap服务端和客户端都支持TLS

论坛徽章:
0
6 [报告]
发表于 2015-01-22 10:26 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
7 [报告]
发表于 2015-01-22 10:29 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
24
天蝎座
日期:2014-05-13 18:05:59IT运维版块每日发帖之星
日期:2015-11-26 06:20:00操作系统版块每月发帖之星
日期:2015-12-02 14:57:54IT运维版块每月发帖之星
日期:2016-01-07 23:01:56IT运维版块每周发帖之星
日期:2016-01-07 23:04:2615-16赛季CBA联赛之青岛
日期:2016-01-23 07:58:272016猴年福章徽章
日期:2016-02-18 15:30:3415-16赛季CBA联赛之北控
日期:2016-03-23 14:20:06IT运维版块每日发帖之星
日期:2016-04-01 06:20:0015-16赛季CBA联赛之吉林
日期:2016-06-28 13:51:54IT运维版块每日发帖之星
日期:2016-07-01 06:20:00IT运维版块每日发帖之星
日期:2015-11-23 06:20:00
8 [报告]
发表于 2015-01-22 15:22 |只看该作者
回复 6# chenzhiquan2000

/usr/local/openldap/libexec/slapd -h "ldap:// ldaps://"  

对照自己的slapd路径启动即可,这时候你除了看到389,还可以看到636

论坛徽章:
1
2015年迎新春徽章
日期:2015-03-04 09:58:11
9 [报告]
发表于 2015-02-26 10:42 |只看该作者
mark 以下, 遇到同行了

论坛徽章:
1
2015年迎新春徽章
日期:2015-03-04 09:56:11
10 [报告]
发表于 2015-02-26 11:44 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP