# LDAP & Webmin

## arut8ur

Hi,

i have just installd the OpenLDAP Server on my system.

For doing so i used the "Gentoo Guide to OpenLDAP Authentication".

Now i want to use Webmin to administrate the ldap server,..

but i keep getting the error message:

```
Failed to connect to LDAP server  port 389. Maybe your module configuration is incorrect.
```

In the module configuration i changed only one option:

```
Linux LDAP NSS library config file: /etc/ldap.conf
```

I don't know what to put in the other,..

Anyone has an idea what's wrong?

thx

Jan

----------

## edebont

Hi,

As far as I can tell the ldap.conf described in "Gentoo Guide to OpenLDAP Authentication" is meant for the remote client. 

The  ldap.conf for the localserver (webmin)  should look like this

```
host 127.0.0.1

base dc=mydomain,dc=com

rootbinddn uid=root,ou=People,dc=mydomain,dc=com

ldap_version 3

pam_filter objectclass=posixAccount

pam_login_attribute uid

pam_member_attribute memberuid

nss_base_passwd ou=People,dc=mydomain,dc=com

nss_base_shadow ou=People,dc=mydomain,dc=com

nss_base_group  ou=Group,dc=mydomain,dc=com

nss_base_hosts  ou=Hosts,dc=mydomain,dc=com

scope one

```

I have configured the rootbinddn since you use Webmin obviously to maintain the LDAP server.  The only thing you need to do now is create an /etc/ldap.secret file which contains root password. You can create it as follows

```

> echo yourrootpassword > /etc/ldap.secret

> chmod 600 /etc/ldap.secret

 
```

This should do the trick.

----------

## arut8ur

Hi,

thanks, this will hep a lot.

----------

## rkasting

I have the exact problem.  Still won't work.

Here is the new error I get when I try your solution:

```
Failed to connect to LDAP server 127.0.0.1 port 389. Maybe your module configuration is incorrect.
```

Any ideas?

----------

## cselkirk

edebont, the /etc/ldap.conf mentioned in the guide is intented for the local machine. LDAP has various method of stipulating the host (host, uri) and these are ment to be FQDN (that is they should be equivilent to "base").

I would first look to see that slapd is running and the port it is running on:

```
lsof -i |grep ldap
```

This should return a number of ldap(s) (that is "ldap://" and/or "ldaps://")

Next see if you can search the directory:

```
ldapsearch -D "cn=Manager,dc=domain,dc=tld" -W
```

If this is successfull then it looks to me that webmin (something I'm not familar with) is misconfigured and/or "localhost" does not equate with "base").

Perhaps add the FQDN for your machine to the localhost line in /etc/hosts.

----------

## rkasting

I verified these things once more, just to be sure... and LDAP is up and working.

Hmm...

----------

## cselkirk

"ldap://" or "ldaps://"? If you followed the Gentoo Guide then it will be "ldaps://" running and not "ldap://" and from the above error from webmin it's explictly trying to connect to port 389 ("ldap://" and not port 636 "ldaps://").

In this thread the poster had a similar problem and disabling TLS ("ldaps://") and running "ldap://" resolved the problem (though I think perhaps webmin may be at issue here).

----------

