# [solved] LDAP connect_to_host error

## decrease789

i followed the gentoo doc on ldap and I get the following error when I test the ldap connection? can anyone help me? please!!!!

```

root@mydomain james # ldapsearch -D "cn=Manager,dc=mydomain,dc=biz" -W -d 255

ldap_create

Enter LDAP Password:

ldap_bind_s

ldap_simple_bind_s

ldap_sasl_bind_s

ldap_sasl_bind

ldap_send_initial_request

ldap_new_connection

ldap_int_open_connection

ldap_connect_to_host: TCP auth.mydomain.biz:636

ldap_connect_to_host: getaddrinfo failed: Name or service not known

ldap_perror

ldap_bind: Can't contact LDAP server (81)

```

Last edited by decrease789 on Mon Feb 28, 2005 7:55 pm; edited 2 times in total

----------

## solomonHk

Kill LDAP and then run sldap.

----------

## decrease789

doesn't help... the server appears to start ok

```

slapd startup: initiated.

bdb_db_open: dc=nicolson,dc=biz

bdb_db_open: dbenv_open(/var/lib/openldap-ldbm)

slapd starting

daemon: added 6r

daemon: select: listen=6 active_threads=0 tvp=NULL

```

but when i run

ldapsearch -D "cn=Manager,dc=mydomain,dc=biz" -W -d 255

i get

```

ldap_create

Enter LDAP Password:

ldap_bind_s

ldap_simple_bind_s

ldap_sasl_bind_s

ldap_sasl_bind

ldap_send_initial_request

ldap_new_connection

ldap_int_open_connection

ldap_connect_to_host: TCP auth.mydomain.biz:636

ldap_new_socket: 3

ldap_prepare_socket: 3

ldap_connect_to_host: Trying 123.45.67.89:636

ldap_connect_timeout: fd: 3 tm: -1 async: 0

ldap_ndelay_on: 3

ldap_is_sock_ready: 3

ldap_is_socket_ready: error on socket 3: errno: 111 (Connection refused)

ldap_close_socket: 3

ldap_perror

ldap_bind: Can't contact LDAP server (81)

```

----------

## UberLord

```
ldapsearch -D "cn=Manager,dc=mydomain,dc=biz" -Wx -d 255
```

Notice the x ....

----------

## decrease789

nope still....

```

ldap_create

Enter LDAP Password:

ldap_bind_s

ldap_simple_bind_s

ldap_sasl_bind_s

ldap_sasl_bind

ldap_send_initial_request

ldap_new_connection

ldap_int_open_connection

ldap_connect_to_host: TCP auth.mydomain.biz:636

ldap_new_socket: 3

ldap_prepare_socket: 3

ldap_connect_to_host: Trying 123.45.67.89:636

ldap_connect_timeout: fd: 3 tm: -1 async: 0

ldap_ndelay_on: 3

ldap_is_sock_ready: 3

ldap_is_socket_ready: error on socket 3: errno: 111 (Connection refused)

ldap_close_socket: 3

ldap_perror

ldap_bind: Can't contact LDAP server (81)

```

----------

## solomonHk

What sort of domain are you connecting to?  What is the DC running?

----------

## decrease789

I am not sure I understand, I am a n00b when it comes to LDAP... and know next to nothing about it, I would like to run it because a few server applications I want to use, use it

I run:Gentoo Linux 2.6.10

qmail / courier-mail / vpopmail / spamassassin / horde email services

imap ssl

smtp ssl

pop ssl

apache 2 with php 5

mysql 4

sshd

samba

pure-ftpd

syslog-ng

vixie-cron

distcc

clamav

my server is behind a router... I have port 636 open though? Do I need the standard ldap port open as well?Last edited by decrease789 on Thu Feb 24, 2005 8:28 pm; edited 1 time in total

----------

## decrease789

well... obviously not because i just opened it and i got the same error

----------

## UberLord

Is you ldap server running on port 636? Check /etc/conf.d/slapd and ensure that ldaps:// is in the list ..

----------

## decrease789

yup....

```
OPTS="-h 'ldaps:// ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock'
```

like i said I followed the guide below...

http://www.gentoo.org/doc/en/ldap-howto.xml

 :Confused: 

----------

## decrease789

can no one help me?

----------

## decrease789

i hadn't used slappasswd -h {MD5}

i have a new problem now though  :Sad: 

see https://forums.gentoo.org/viewtopic-p-2139256.html

----------

