From: Chris R. <chr...@me...> - 2001-07-11 07:38:14
|
Lakshmi Marellapudy <lm...@fl...> wrote: > Knut Sander wrote: > >> Hi Lakshmi, >> >> Lakshmi Marellapudy wrote: >> > I have openldap running on my server(192.104.61.84), under my home >> > directory. >> > I assumed that it is on port 389. >> > when I tried to connect through perldap I got an error. >> >> assumptions may be wrong, it's much better to proof them =) >> >> Which host and port did you specify at startup? >> >> Your commandline shold look like: >> >> slapd -f /opt/openldap/etc/openldap/slapd.conf -h ldap://localhost:389/ >> >> This starts slapd on port 389 and binds only to localhost, so it is only >> reachable via ldapsearch -h localhost -p 389 ... >> >> You can also use netstat to list all open sockets on your host and hav a >> look into the slapd.args file (near slapd.pid). >> >> regards, >> Knut > > I gave the below commands, and slapd is running. > ------------------------------------------------------------------- > [hugo.evanston.fluent.com 15%]./libexec/slapd -f ./etc/openldap/slapd.conf > -h ldap://localhost:389/ > [hugo.evanston.fluent.com 16%]./bin/ldapsearch -h localhost -p 389 > version: 2 > > # > # filter: (objectclass=*) > # requesting: ALL > # > > # search result > search: 2 > result: 10 Referral > ref: hugo.evanston.fluent.com > > # numResponses: 1 > [hugo.evanston.fluent.com 17%] > -------------------------------------------------------------- > but when I gave $server = "127.0.0.1:389" in the perl code, I still got > timeout error. > > Could anyone please help me. > > Lakshmi > > Your server is apparently listening to the localhost interface on port 389. However, you haven't said whether it is listening on any other network interfaces, eg 192.104.61.84. Listening on one interface does *not* imply listening on others! If you want to listen on 'all interfaces', use the IP address 0.0.0.0 when starting slapd (maybe '-h ldap://0.0.0.0:389/' in the command line arguments, but since I don't use slapd that may be incorrect.) The netstat command should tell you what interfaces your slapd is actually listening on. Since the localhost address apparently works for ldapsearch, try it in perl: $ldap = new Net::LDAP('127.0.0.1', port => 389); Cheers, Chris |