Hi,

"noemie.petig...@bluewin.ch" <noemie.petig...@bluewin.ch> writes:

> Hi All,
>
> I'm a beginner in Unix and LDAP and I have to create a LDAP directory
> to store information. I have a ldap server on a machine which works (I
> can make queries, adding entries on the LDAP, ...) Now, I try to
> connect another machine to this LDAP server via a script Perl. Here is
> my script (very basic to begin)
The most imported information is not given :-(

> #!/usr/bin/perl -w
> use strict;
> use Net::LDAP;
> my $ldapHost = "XXXX";

What is the value of ldapHopst? This should be either a fully
qualified domain name, a URL according to RFC 4516 or an IP-Adress,
whatever you define it has to be resolvable.

> my $user = "XXXX";

What is the value of user? As you do a simple bind, this has to be a
distinguished name.

> my $pw = "XXXX";

Same question here. Do you present clear text or a hashed value?


> my $ldap = Net::LDAP->new($ldapHost, timeout=>240) or die "Can't bind
> to ldap: $!...@\n";
> print "NEW\n";
> $ldap->bind(dn=>$user, password=>$pw);
> print "BIND\n";
> $ldap->unbind;
> print "---------end-----------\n";
>
> My ldapHost is reachable from the client (A ping gives an answer)

Ping is not relevant here, can you reach port 389 on this host? There
are probably firewall rules to prevent connenction on ldap port

[...]
> I also noticed that a query on the LDAP server takes a long time
> (Almost one minute for a simple ldapsearch query) Is it normal? or is
> it linked with my problem?

This depends on the settings for client timeout.

> As I said before, I'm a really beginner. Feel free to ask if you need
> more information.
>
> I hope somebody will have a solution or help for me

Your questions are more ldap related and not specific to perl-ldap,
asking on a ldap specific mailing list would be more appropriate.

-Dieter 

-- 
Dieter Klünter | Systemberatung
http://dkluenter.de
GPG Key ID:8EF7B6C6
53°08'09,95"N
10°08'02,42"E

Reply via email to