LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-02-2014, 03:51 PM   #1
project722
Member
 
Registered: Jun 2009
Posts: 53

Rep: Reputation: 0
OpenLDAP cant find server - not binding to IP/port


I am having multiple issues trying to get OpenLDAP-Server installed. Here is my environment:

Ubuntu 14.04 LTS - (not "server edition") running in VirtualBox on a Win 7 Prox86 machine.

Installed OpenLDAP server with this command - "sudo apt-get install slapd ldap-utils"

Everything went smooth - no issues.

Hosts file entry looks like this- "127.0.0.1 ldap.example.com ldap"

I am following the guide here - https://help.ubuntu.com/14.04/server...ap-server.html

I can run this - "sudo ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config dn" to get the output listed in the guide without issue.

However this next step:

"ldapsearch -x -LLL -H ldap:/// -b dc=ldap,dc=example,dc=com dn" returns this:

"ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)

I notice that when I run "netstat -plane | grep ":389" I do not see the ldap server (127.0.0.1) listening on 389. I get this:

tcp 0 0 0.0.0.0:389 1062/slapd

This may be part of the problem but I do not see how or where to force the slapd process to listen on 127.0.0.1 over port 389. I do not have anything in /etc/ldap/sasl2 and I replaced my Ldap.conf file with a sample file I found on the internet. ( I removed it earlier as a TS step) Any help is greatly appreciated.
 
Old 06-02-2014, 04:21 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,931

Rep: Reputation: Disabled
Quote:
Originally Posted by project722 View Post
"ldapsearch -x -LLL -H ldap:/// -b dc=ldap,dc=example,dc=com dn" returns this:

"ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)

I notice that when I run "netstat -plane | grep ":389" I do not see the ldap server (127.0.0.1) listening on 389. I get this:

tcp 0 0 0.0.0.0:389 1062/slapd
slapd is the OpenLDAP server, and it's already listening on port 389 on all IP addresses (0.0.0.0).

The "bind" referred to by the error message is not an IP socket bind, but an "LDAP bind", which is another name for authentication against an LDAP server. That's why there's a reference to SASL.

I assume the real LDAPURI behind the -H parameter was an actual host name, and not just "ldap:///"? If not, then there's your problem.

(If you want someone to comment on your configuration, you'll need to post the contents of your OpenLDAP configuration file, which by the way is normally called slapd.conf.)

Last edited by Ser Olmy; 06-02-2014 at 04:54 PM.
 
Old 06-02-2014, 04:48 PM   #3
project722
Member
 
Registered: Jun 2009
Posts: 53

Original Poster
Rep: Reputation: 0
Ok I found a formatting problem in my ldapuri. Now the command produces the correct output. I notice however I do not have a slapd.conf file. Running "sudo find -name slapd.conf" returns nothing. Thanks for the help.
 
Old 06-02-2014, 05:01 PM   #4
project722
Member
 
Registered: Jun 2009
Posts: 53

Original Poster
Rep: Reputation: 0
In addition to not having or being able to find the slapd.conf file, moving along in the guide - when I run this to add my content to the database:

ldapadd -x -D cn=admin,dc-ldap,dc=example,dc=com -W -f /etc/ldap/slapd.d/add_content.ldif

After I put in my LDAP password I get the same error as above:

"ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
 
Old 06-02-2014, 05:13 PM   #5
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,931

Rep: Reputation: Disabled
Quote:
Originally Posted by project722 View Post
ldapadd -x -D cn=admin,dc-ldap,dc=example,dc=com -W -f /etc/ldap/slapd.d/add_content.ldif
I don't see a -H or -h parameter telling ldapadd which server it's supposed to connect to. I don't know if it defaults to localhost or not, but adding a -H parameter couldn't hurt.
 
Old 06-02-2014, 05:28 PM   #6
project722
Member
 
Registered: Jun 2009
Posts: 53

Original Poster
Rep: Reputation: 0
Adding -H worked. Strange this is I remember this command worked before without having to use it. Of course that was my first run with setting up this test environment using the guide. I did something along the way trying to work out a few issues I suppose, there's no telling. Oh BTW I don't recall the link, but I remember reading that my version of Ubuntu with OpenLDAP server does not use slapd.conf but instead uses cn=config which is used with ldapmodify. Thanks again
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nss_ldap, openldap and openldap-server ... what is openldap for? chakkerz Linux - Server 2 08-13-2009 07:16 PM
binding port mokku Linux - Newbie 4 11-10-2007 05:51 PM
Azureus port binding G00fy Linux - Networking 0 07-18-2006 02:15 AM
PsyBNC not binding on port 80. Adam15906 Linux - Software 1 06-10-2004 11:24 AM
portsentry 111 port not binding saag Linux - Security 4 03-19-2004 09:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration