Install Openldap On Win32

install openldap win32

download openldap-*-db-*-openssl-*-BDB_ONLY-win32_Setup.exe
Install it as NT service.

last tested with openldap-2.2.29

change listening port

If you install on a windows 200? Server with AD you need to specify another port for ldap.
Change the port by adding this registry key.


download here

generate encrypted password

C:\Program Files\OpenLDAP>slappasswd.exe 
New password: Re-enter new password: {SSHA}Xe1ybaVBI/PMlO6XO0XXbMexpHEbSg1f

copy paste the {SSHA}Xe1ybaVBI/PMlO6XO0XXbMexpHEbSg1f in slapd.conf behind rootpw

configure openldap

In c:\Program Files\OpenLDAP\slapd.conf

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

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

# BDB database definitions

database    bdb
suffix        "dc=domain,dc=com"
rootdn        "cn=Manager,dc=domain,dc=com"
rootpw        {SSHA}Xe1ybaVBI/PMlO6XO0XXbMexpHEbSg1f

directory    ./data

index    objectClass    eq

Test the server

configure ldap client

In c:\Program Files\OpenLDAP\lapd.conf

URI    ldap://foo:700/

test the server

Stop the openldap service

net stop openldap-slapd
ldapsearch -x -s base (objectclass=*) namingContexts

this should give ldap_bind: Can't contact LDAP server (-1)
if not your lapd.conf is not correctly configured and you are quering your AD ldap service!

net start openldap-slapd
ldapsearch -x -s base (objectclass=*) namingContexts

will give
# extended LDIF
# LDAPv3
# base <> with scope base
# filter: (objectclass=*)
# requesting: namingContexts

namingContexts: dc=domain,dc=com

# search result
search: 2
result: 0 Success

create basic ldap entries

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):
Don't put any tabs and spaces before the text in the ldif file!

dn: dc=domain,dc=com
objectclass: top
objectclass: dcObject
objectclass: organization
dc: domain
o: domain

dn: cn=Manager,dc=domain,dc=org
objectclass: organizationalRole
cn: Manager
slapadd -f slapd.conf -l init.ldif


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.