How to setup PerLDAP

From: Warren Liang (warren.liang_at_cox.net)
Date: 05/06/05

  • Next message: Andreas Höschler: "Can't kill process"
    To: <sunmanagers@sunmanagers.org>
    Date: Fri, 6 May 2005 13:10:54 -0400
    
    

    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


  • Next message: Andreas Höschler: "Can't kill process"

    Relevant Pages

    • Re: nameserver changing
      ... Re: nameserver changing: ... >> None of the machines are running their own dns servers. ... >script that will be scp'ed and executed on each host. ... >and then create one Perl script for every host. ...
      (freebsd-questions)
    • Re: nameserver changing
      ... > list of dns's used as resolvers by particular machineon a network which I ... > None of the machines are running their own dns servers. ... script that will be scp'ed and executed on each host. ... and then create one Perl script for every host. ...
      (freebsd-questions)
    • Re: Bash: How do I quote CR &| LF in a command?
      ... >> I want to do in bash what the above perl script does. ... Thanks for your reply too Stephane - I need the Host: header because ... I'm working with LVS real servers inside the realserver network, ...
      (comp.unix.shell)
    • scripting gethostbyname
      ... Here's a 3 line perl script that prints the IP address of a named host: ... use Socket; ...
      (microsoft.public.scripting.vbscript)
    • Script to create new Sun One Directory Server 5.x instance?
      ... There is a perl script available from Sun that will create a new ... It's called create_instance.pl Sun ... states that "This tool is not compatible with Directory Server 5.x." ... will provide the same functionality for Directory Server 5.x? ...
      (comp.sys.sun.apps)