Build an LDAP server in Windows

Source: Internet
Author: User
Tags ldapsearch openldap

Http://wiki.zimbra.com/wiki/UNIX_and_Windows_Accounts_in_Zimbra_LDAP_and_Zimbra_Admin_UI

 

Address: http://mguessan.free.fr/nt/openldap_en.html

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

Modify the include./Schema/CORE. schema in slapd. conf:

Include./Schema/CORE. Schema
Include./Schema/cosine. Schema
Include./Schema/Misc. Schema
Include./Schema/inetorgperson. Schema

Original article:

Specified specified cial 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 wocould 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 between des 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 perform CT any message, but leave the command window open for the next steps. if you want debug information, use the-D switch:

Slapd-D 1 server 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 operate 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 already ded 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.

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/gzaqq/archive/2007/06/20/1659717.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.