Difference between revisions of "Install and configure OpenLDAP"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
Line 65: Line 65:
 
ldapadd -f init.ldif -D "cn=admin,dc=mydomain,dc=com" -w secret
 
ldapadd -f init.ldif -D "cn=admin,dc=mydomain,dc=com" -w secret
 
</source>
 
</source>
 +
 +
= Troubleshooting =
 +
With Windows, it server is stop suddenly, restart of OpenLDAP may fails with error
 +
''Program version x.y doesn't match environment version''
 +
 +
To confirm problem, go onto DOS under directory data of OpenLDAP and launch command
 +
<source lang="bash">
 +
..\db_stat -e
 +
</source>
 +
If message is the one described, launch repare of base with
 +
<source lang="bash">
 +
..\db_recover
 +
</source>
 +
Server should be able to start again.

Revision as of 12:12, 24 October 2012

En verysmall.png Page waiting for translation. To translate, create an account, go back and clic on "Modify".
Fr verysmall.png Page en attente de traduction. Pour traduire, créez un compte, revenez et cliquez sur "Modifier".
Es verysmall.png Página a traducir. Para traducirla, cree una cuenta, vuelva a la página y haga clic en "editar".
It verysmall.png Pagina da tradurre. Per tradurla, crea un utente, torna indietro e clicca su "modifica".
Pt verysmall.png Página a aguardar por tradução. Para traduzir, crie uma conta, volte atrás e clique em "Modificar".
De verysmall.png Seite wartet auf Übersetzung. Um Übersetzung zu erstellen, richte einen Account ein, geh zurück und klicke auf "bearbeiten".
Zh verysmall.png 页面等待翻译。若要翻译本页,先创建一个帐户、登录并返回本页后单击“编辑”。

Ce chapitre ne concerne pas Dolibarr. Il contient un exemple d'instructions pour installer un annuaire LDAP qui pourra éventuellement être interfacé avec Dolibarr.

Install LDAP server

  • With Ubuntu or Debian, install package slapd and ldap.
  • With Windows, you can use the install program of OpenLDAP.

Once this is done, you have an empty LDAP server launched as a service.

Setup server

For Ubuntu, see page http://doc.ubuntu-fr.org/openldap-server

Otherwise the DN root, user and password to connect are available into file slapd.conf. Port may also be into this file, if not, it is default port value: 389.

Stop the service

Modify file slapd.conf to use your domain name (replace all dc=my-domain,dc=com by value of your choice).

Modify file slapd.conf also to add includes of schemas you will need to declare your LDAP objects.

include		./schema/core.schema
include		./schema/cosine.schema
include		./schema/inetorgperson.schema
include		./schema/nis.schema

Restart the service.

Test server

With a LDAP browser like JXplorer, you can try to connect to your LDAP server using the admin LDAP user. Credentials by default are:

  • Server: Localhost
  • Port: 389
  • User: cn=admin,dc=example,dc=com or cn=Manager,dc=example,dc=com
  • Password: secret
  • Base DN (optionnel): keep empty of set dc=yourdomain,dc=com

Create your LDAP tree

Next step is to define information to store into your LDAP.

Create a file init.ldif with your organization. For example:

# Organization
dn: dc=mydomain,dc=com
objectclass: dcObject
objectclass: organization
dc: mydomain
o: Description of annuary
description: The description of annuary
# Setting up container for Users OU
dn: ou=People,dc=mydomain,dc=com
objectclass: top
objectclass: organizationalUnit
ou: People
# Setting up container for groups
dn: ou=Groups,dc=mydomain,dc=com
objectclass: top
objectclass: organizationalUnit
ou: Groups

Execute file using the LDAP admin user:

ldapadd -f init.ldif -D "cn=Manager,dc=mydomain,dc=com" -w secret
or
ldapadd -f init.ldif -D "cn=admin,dc=mydomain,dc=com" -w secret

Troubleshooting

With Windows, it server is stop suddenly, restart of OpenLDAP may fails with error Program version x.y doesn't match environment version

To confirm problem, go onto DOS under directory data of OpenLDAP and launch command

..\db_stat -e

If message is the one described, launch repare of base with

..\db_recover

Server should be able to start again.