1.Download and install OpenLDAP for Windows, Current version 2.2.29
: Http://download.bergmans.us/openldap/openldap-2.2.29/openldap-2.2.29-db-4.3.29-openssl-0.9.8a-win32_Setup.exe
Link: http://lucas.bergmans.us/hacks/openldap/
The installation is very simple. Just click Next. Suppose we install it in C:/OpenLDAP.
2.Configure OpenLDAP, Edit the sldap. conf file
1) Open C:/OpenLDAP/sldap. conf and find
Include C:/OpenLDAP/etc/Schema/CORE. schema, add
Include C:/OpenLDAP/etc/Schema/cosine. Schema
Include C:/OpenLDAP/etc/Schema/inetorgperson. Schema
In the following example, you only need to use the above three schemas. Of course, if you want to use them, you can add all the other schemas.
Include C:/OpenLDAP/etc/Schema/CORBA. Schema
Include C:/OpenLDAP/etc/Schema/dyngroup. Schema
Include C:/OpenLDAP/etc/Schema/Java. Schema
Include C:/OpenLDAP/etc/Schema/Misc. Schema
Include C:/OpenLDAP/etc/Schema/NIS. Schema
Include C:/OpenLDAP/etc/Schema/OpenLDAP. Schema
2) In the sldap. conf file, find
Suffix "DC = My-domain, Dc = com"
Rootdn "cn = manager, Dc = My-domain, Dc = com"
Change the two rows
Suffix "DC = example, Dc = com"
Rootdn "cn = manager, Dc = example, Dc = com"
Suffix depends on how it is defined, and the ldif file in the subsequent steps must be defined with it. Note that there is a rootpw secret in this configuration file. This secret is the password for Cn = manager and will be used later. However, here is the plaintext password. You can use the command: slappasswd-H {MD5}-s secret calculates the encrypted password {MD5} xr4ilozq4pcoq3aq0qbuaq = to replace the secret in the configuration.
3.Start OpenLDAP
Run cmd to go to C:/OpenLDAP and run the command slapd-D 1.
You can see that a piece of information is printed in the console. OpenLDAP uses the Berkeley DB database to store directory data by default.
4.Create entries, Edit and import the ldif File
1) Create an ldif (LDAP data interchanged format) file (in plain text format), for example, test. ldif. The file content is as follows:
DN: DC = example, Dc = com
Objectclass: dcobject
Objectclass: Organization
O: Example Company
DC: Example
DN: Cn = manager, Dc = example, Dc = com
Objectclass: organizationalrole
CN: Manager
2) run the following command: ldapadd-X-d "cn = manager, Dc = example, Dc = com"-W secret-F test. ldif.
Import organization information and Roles