开发者社区> cnbird> 正文
阿里云
为了无法计算的价值
打开APP
阿里云APP内打开

WINDOWS下搭建LDAP服务器

简介: http://wiki.zimbra.com/wiki/UNIX_and_Windows_Accounts_in_Zimbra_LDAP_and_Zimbra_Admin_UI   原文地址: http://mguessan.
+关注继续查看

http://wiki.zimbra.com/wiki/UNIX_and_Windows_Accounts_in_Zimbra_LDAP_and_Zimbra_Admin_UI

 

原文地址: http://mguessan.free.fr/nt/openldap_en.html

LDAP服务器:http://download.bergmans.us/openldap/openldap-2.2.29/openldap-2.2.29-db-4.3.29-openssl-0.9.8a-win32_Setup.exe

 还要修改一个地方:在slapd.conf中把include         ./schema/core.schema改成:

include         ./schema/core.schema
include         ./schema/cosine.schema
include         ./schema/misc.schema
include         ./schema/inetorgperson.schema

原文:

Many commercial solutions are available to build an LDAP directory. However most products are either very expensive or not standards compliant (e.g. Active Directory).

OpenLDAP is an Opensource LDAP server designed for Unix platforms. A Windows release of this solution would be valuable for those who are stuck to a Microsoft Windows environment.

Thanks to Lucas Bergman, from FiveSight , such release is available. He developed the necessary patches and build process to deliver a binary package ready for use. The initial version hosted at FiveSight is no longer available, but Lucas keeps working on the windows port and built a new release, complete with installer: ( http://lucas.bergmans.us/hacks/openldap/ ). Lucas is now lucky enough to work mainly on Unix and Matthias Mohr has taken the lead. His updated builds are available at: http://download.bergmans.us/openldap/openldap-2.2.29/openldap-2.2.29-db-4.3.29-openssl-0.9.8a-win32_Setup.exe

For the impatients, or those who don't want to bother with config files, the Ilex company released another version with a more comprehensive installer, but an older version of OpenLDAP. This package is available at: http://www.ilex.fr/openldap.htm .

Installation

Download the OpenLDAP installer from: http://download.bergmans.us/openldap/openldap-2.2.29/openldap-2.2.29-db-4.3.29-openssl-0.9.8a-win32_Setup.exe .

Launch the installer, select language, accept license and choose target installation directory. The default is: c:/Program Files/OpenLDAP . As spaces in directory names usually lead to trouble, choose another place, e.g. c:/openldap .

Matthias improved the installer to automatically register OpenLDAP as an NT service and install BDB tools. Those are useful to fix a broken database after a system crash.

 

The installer let you choose service start up mode (auto or manual) and automatically builds a valid configuration. The OpenLDAP start up files are stored in c:/openldap/run , the directory data files end up in c:/openldap/var/openldap-data .

Configuration

The main OpenLDAP configuration file is slapd.conf . It has to be customized before launching the server.

This is just a quick start guide, please have a look at the official OpenLDAP documentation for more information.

Specify the Unicode data directory, by default: ./ucdata .
Choose the needed LDAP schemas. Schemas define directory structure, like columns and tables in a relational database. The core schema is mandatory, add the java schema if you intend to use OpenLDAP as a JNDI server.
Configure the path for OpenLDAP pid and args start up files. The first contains the server pid, the second includes command line arguments.
Choose the database type, by default bdb (Berkeley DB).
Specify the server suffix. All entries in the directory will have this suffix, which represents the root of the directory tree. For example, with suffix "dc=guessant,dc=org" , the fully qualified name of all entries in the database will end with: dc=guessant,dc=org .
Define the name of the administrator entry for the server, named the rootdn , along with its password rootpw . This is the super user of the server. The rootdn name must match the suffix defined above. As stated, all entry names must end with the suffix, and the rootdn is an entry.
Example configuration file:

ucdata-path ./ucdata
include ./schema/core.schema

pidfile ./run/slapd.pid
argsfile ./run/slapd.args

database bdb
suffix "dc=guessant,dc=org"
rootdn "cn=Manager,dc=guessant,dc=org"
rootpw secret
directory ./dataStartup

The slapd.exe executable is the OpenLDAP server. Double click on this file or launch it from a command line. Do not expect any message, but leave the command window open for the next steps. If you want debug information, use the -d switch:

slapd -d 1Server test

The OpenLDAP command line tools can be used to test the server. The following command executes a search query on the server:

ldapsearch -x -s base (objectclass=*) namingContextsType this command in a cmd window positioned in the OpenLDAP installation directory. For more information on search syntax, try ldapsearch -? .

In order to ease server administration, you can switch to a graphical LDAP client, such as the LDAP Browser/Editor developed by Jarek Gawor, available at: http://www.iit.edu/~gawojar/ldap

Start the client and provide connection information:

 

The connection must succeed, but an error message is displayed in the status bar: List Failed . This error is expected as there is no entry in the database, double click on the message to get more details.

Build directory content

In order to insert the first entries in the database, create an init.ldif file and add the following content (according to the configuration specified in slapd.conf):

dn: dc=guessant,dc=org
objectclass: top
objectclass: dcObject
objectclass: organization
o: Guessant
dc: guessant

dn: cn=Manager,dc=guessant,dc=org
objectclass: organizationalRole
cn: ManagerCreate this file directly in OpenLDAP installation directory or anywhere after adding the installation directory to the system PATH.

Load entries in directory (adjust slapd.conf and init.ldif files path as needed):

slapadd -f slapd.conf -l init.ldifThe slapadd command bypasses the LDAP server and applies changes directly to the BDB database. Restart the server to flush its cache.

Try a new connection with Ldap Browser to check the new entries. A named (i.e. not Anonymous) connection is necessary to add or change entries: uncheck Anonymous Bind and provide User Info.

According to example configuration, User DN is cn=Manager , check append base DN and use password secret .

 

Install as an NT service

In order to have the server always available, register OpenLDAP as a Windows service. If the option was not checked at installation time, use the following command:

slapd installAnd to remove the service:

slapd removeOpenLDAP daemon parameters can be modified by creating registry keys. Create a .reg file with the following content en register keys by double clicking on it:

REGEDIT4

[HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/OpenLDAP-slapd/Parameters]
"DebugLevel"=dword:00000000
"ConfigFile"=".//slapd.conf"
"Urls"="ldap:///"See README.txt file included in the distribution for more information on registry keys search algorithm.

DebugLevel is used to change trace level, ConfigFile is the configuration file path and Urls matches the syntax of the -h command line option.

For example, set Urls to ldap://localhost:port/ to set a different listen port.


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/gzaqq/archive/2007/06/20/1659717.aspx

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
如何远程连接Windows服务器
如果您忘记密码,请重置密码后再次尝试远程连接。具体操作,请查看我的下篇文章 如果远程连接时出现身份验证错误,您需要手动排查解决。具体操作,请查看我的远程连接Windows实例时出现身份验证错误的处理方法
63 0
远程连接Windows服务器
远程连接Windows服务器
101 0
远程连接 Windows 服务器
最近有小伙伴在群里买了云服务器 问题引出 大哥,忙吗?为什么连不上, 问清楚服务器类型之后就开始帮助他
53 0
【镜像更新】Windows Server 2019 数据中心版
信息摘要: Windows Server 2019 数据中心版镜像更新适用客户: 使用Windows Server的用户版本/规格功能: 镜像ID: win2019_64_dtc_1809_zh-cn_40G_alibase_20190318.
4590 0
Windows server2003配置ftp服务
版权声明:欢迎转载,请注明沉默王二原创。 https://blog.csdn.net/qing_gee/article/details/45010139 前言:如果你已经非常清楚的掌握了Windows server 2003的安全机制,那么你可以通过开启Windows自带的ftp服务进行使用,不过很多情况下,这不安全,但是我会告诉你方法,这需要你的Windows安装目录下有对应的ftp安装包。
687 0
+关注
cnbird
阿里云安全专家,主要负责阿里云云产品安全。
4032
文章
3
问答
文章排行榜
最热
最新
相关电子书
更多
低代码开发师(初级)实战教程
立即下载
阿里巴巴DevOps 最佳实践手册
立即下载
冬季实战营第三期:MySQL数据库进阶实战
立即下载