public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Joost Roeleveld <joost@antarean.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] OpenLDAP works only at localhost, not from outside
Date: Fri, 02 Sep 2011 08:50:46 +0200	[thread overview]
Message-ID: <2117779.58rmGC8WoN@eve> (raw)
In-Reply-To: <20110831182426.79c1b146@polaris>

On Wednesday, August 31, 2011 06:24:26 PM Johannes Geiss wrote:
> Hi there,
> 
> I want to access my LDAP-data from anywhere on the internet but I only
> get it working on localhost.
> 
> I installed OpenLDAP 2.4.24, and tried to do the tutorial at
> 
>     http://www.yolinux.com/TUTORIALS/LinuxTutorialLDAP.html
> 
> The LDAP database works fine from localhost with
> 
>     ldapsearch -vLx -b "o=stooges" "(sn=Fine)" -h localhost
> 
> but if I try to do it from the outside (ie. the IP address my router
> gave me via DHCP)

What do you mean with, "outside"?
> 
>     ldapsearch -vLx -b "o=stooges" "(sn=Fine)" -h xxx.xxx.xxx.xxx
> 
> I get the output "ldap_initialize( ldap://xxx.xxx.xxx.xxx )" and the
> client hangs.
> 
> The slapd server prints
> 
> slap_listener_activate(6):
> >>> slap_listener(ldap:///)

Interesting, this should indicate that it does bind to all interfaces.

> 
> and hangs at this point until I Ctrl-C the client or wait approx. 5
> Minutes.

5 minutes is a time-out.

> Does anybody successfully installed an LDAP-service with access from
> the outside? What is the content of slapd.conf?

Yes, slapd.conf doesn't decide this though
> 
> Did I miss anything else?

If it weren't for the log from the slapd logs, I'd answer with the following 
bit:

First the short answer:
*** /etc/conf.d/slapd ***
# conf.d file for openldap
#
OPTS="-f /etc/openldap/slapd.conf -h 'ldaps:// ldap:// 
ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock' -4"
*********

The long answer:

You need to configure "slapd" to listen to all interfaces, you do this by 
setting the "-h " options correctly. I use both SSL and non-SSL for my LDAP 
and also set a socket-file:
" -h 'ldaps:// ldap:// ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock'"

See "man slapd" for more information.

However, the logs show that this should already work.
This makes me wonder about the following possible causes:

1) Outside = on the other side of the router
2) A firewall on your machine is blocking access

These have the following solutions:
1) Forward the correct port (386) to your machine
2) Reconfigure your firewall

Another thing to try would be to check if there is actually something 
listening on the correct port:
# netstat -an | grep 389

This should return a line like:
**
tcp        0      0 0.0.0.0:389             0.0.0.0:*               LISTEN     
**

You could also have a look at the Gentoo-LDAP page:
http://www.gentoo.org/doc/en/ldap-howto.xml

Hope this helps.

--
Joost



  reply	other threads:[~2011-09-02  6:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-31 16:24 [gentoo-user] OpenLDAP works only at localhost, not from outside Johannes Geiss
2011-09-02  6:50 ` Joost Roeleveld [this message]
2011-09-05  4:50   ` Johannes Geiss
2011-09-05  9:25     ` Joost Roeleveld
2011-09-06 15:18     ` Michael Mol

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2117779.58rmGC8WoN@eve \
    --to=joost@antarean.org \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox