Sun Directory Server Enterprise Edition 7.0 Administration Guide

Procedure To Load Sample Data in Directory Server Instance

Examples that use command-line tools depend on sample data residing under the dc=example,dc=com suffix of your directory.

You can set up part of the data that is required by creating a dc=example,dc=com suffix. You can then populate the suffix with entries from the install-path/dsee7/resources/ldif/Example.ldif file.

  1. Create a new Directory Server instance and start the instance.


    $ dsadm create -p port -P SSL-port instance-path
    $ dsadm start instance-path
    
  2. Read the Example.ldif file to find bind passwords needed in the examples.

  3. Create suffix and load the Example.ldif content into the directory by using the following commands:


    $ dsconf create-suffix -h localhost -p 1389 dc=example,dc=com
    $ dsconf import -h localhost -p 1389 \
    install-path/dsee7/resources/ldif/Example.ldif dc=example,dc=com

    For more information, see To Create a Directory Server Instance.

  4. Generate test data for examples by using the makeldif(1) command, as shown in the next step, and the following template:

    define suffix=dc=example,dc=com
    define maildomain=example.com
    
    branch: ou=test,[suffix]
    subordinateTemplate: person:100
    
    template: person
    rdnAttr: uid
    objectclass: top
    objectclass: person
    objectclass: organizationalPerson
    objectclass: inetOrgPerson
    givenName: <first>
    sn: <last>
    cn: {givenName} {sn}
    initials: {givenName:1}{sn:1}
    employeeNumber: <sequential>
    uid: test{employeeNumber}
    mail: {uid}@[maildomain]
    userPassword: auth{employeeNumber}{employeeNumber}
    telephoneNumber: <random>
    description: This is the description for {cn}.
  5. Create a test.template file and copy the template content, as shown above, into it. Use commands such as the following to generate the data in test.ldif and to load the content into the directory.


    Note –

    The test.template file must be created in the install-path/dsee7/dsrk/bin/example_files directory.



    $ cd install-path/dsee7/dsrk/bin/example_files
    $ ../makeldif -t test.template -o test.ldif
    Processing complete.
    101 total entries written.
    $ ../ldapmodify -a -c -D uid=hmiller,dc=example,dc=com -w - -f test.ldif
    Enter bind password:
    …

    If you read Example.ldif, you see that the password for hmiller is hillock.


    Note –

    This step is specific to the zip installation because the makeldif command is available only in the zip distribution.