How to setup PerLDAP

From: Warren Liang (warren.liang@cox.net)
Date: Fri May 06 2005 - 13:10:54 EDT


Hello:

We have Sun One Directory Server up and running on a Solaris 9 host. Like to perform LDAP management tasks, such as create new user account ,change password, etc, from WEB-based interface. By following Sun bluebook LDAP in the Solaris Operating Environment (p377), I have done the following:
1.Download Sun One Directory Server Resource Kit 5.2 and install it on /opt/mps/serverroot (same as Sun One Directory Server).
2.Copy directory and files /usr/ds/v5.2/nsPerl5.006_01/lib/site/Mozilla to /usr/perl5/site_perl5/5.6.1
3.Install PerLDAP from binary package perldap-solaris2-sparc.pkg
4.Add /opt/mps/serverroot/lib/ldapcsdk/lib, /opt/mps/serverroot/lib, and /opt/mps/serverroot/lib/nss/lib to LD_LIBRARY_PATH variable.

Copy a test Perl script getentry.pl on page 380:
#!/usr/bin/perl
use Mozilla::LDAP::Conn;
my $host = "localhost";
my $port = 389;
my $dn = "";
my $passwd = "";
my $base = "ou=pepole,dc=mydomain,dc=com";
my $filter = "uid=$ARGV[0]";
my $scope = "subtree";
my $conn = new Mozilla::LDAP::Conn($host,$port,$dn,$passwd);
die "Could not connect to LDAP $host" unless $conn
my $entry = $conn->search($base, $scope, $filter);
while($entry)
        {
                $entry->printLDIF();
                $entry = $conn->nextEntry;
        }
        print "\";
$conn->close if $conn;

To run this Perl script, I enter
# perl getentry.pl
Can't locate loadable object for module Mozilla::LDAP::API in @INC (@INC contains: /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib /usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int /usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at /usr/perl5/site_perl/5.6.1/Mozilla/LDAP/Utils.pm line 29
Compilation failed in require at /usr/perl5/site_perl/5.6.1/Mozilla/LDAP/Utils.pm line 29.
BEGIN failed--compilation aborted at /usr/perl5/site_perl/5.6.1/Mozilla/LDAP/Utils.pm line 29.
Compilation failed in require at /usr/perl5/site_perl/5.6.1/Mozilla/LDAP/Conn.pm line 32.
BEGIN failed--compilation aborted at /usr/perl5/site_perl/5.6.1/Mozilla/LDAP/Conn.pm line 32.
Compilation failed in require at getentry.pl line 3.
BEGIN failed--compilation aborted at getentry.pl line 3.
It obvious that I missed something while setting up PerLDAP.

Background:
O/S: Sun Solaris 9
Directory Server: Sun One Directory Server V5.2
Directory Server Root: /opt/mps/serverroot
DSRK_Root: /opt/mps/serverroot

Thanks in advance.
Warren
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:30:39 EDT