You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by sz...@apache.org on 2010/09/05 16:18:10 UTC
svn commit: r992790 -
/directory/apacheds-manuals/trunk/src/basic-user-guide/handling-of-data-1-connecting.xml
Author: szoerner
Date: Sun Sep 5 14:18:09 2010
New Revision: 992790
URL: http://svn.apache.org/viewvc?rev=992790&view=rev
Log:
Content for command line tools (ldapsearch etc.) added
Modified:
directory/apacheds-manuals/trunk/src/basic-user-guide/handling-of-data-1-connecting.xml
Modified: directory/apacheds-manuals/trunk/src/basic-user-guide/handling-of-data-1-connecting.xml
URL: http://svn.apache.org/viewvc/directory/apacheds-manuals/trunk/src/basic-user-guide/handling-of-data-1-connecting.xml?rev=992790&r1=992789&r2=992790&view=diff
==============================================================================
--- directory/apacheds-manuals/trunk/src/basic-user-guide/handling-of-data-1-connecting.xml (original)
+++ directory/apacheds-manuals/trunk/src/basic-user-guide/handling-of-data-1-connecting.xml Sun Sep 5 14:18:09 2010
@@ -28,6 +28,208 @@ under the License.
xml:lang="en">
<title>Connecting to a server</title>
+
+ <section id="Connecting to a server Studio">
+ <title>Apache Directory Studio</title>
+
+ </section>
+
+ <section id="Connecting to a server Command line tools">
+ <title>Command line tools</title>
+
+ <para>
+ This sections describes how to connect to ApacheDS with command line tools,
+ which are not part of the distribution, but present on many operating systems.
+ Is is also possible to download them separately, e.g. for the Windows platform.
+ </para>
+
+ <section>
+ <title>A powerful alternative to UI tools</title>
+
+ <para>
+ An alternative to UI tools for connecting to your directory and perform operations are command line tools.
+ The traditional commands are part of many applications (for instance Lotus notes),
+ LDAP servers, and even operating systems (e.g. Sun Solaris 8 ff.).
+ The following table lists the names and functions of common commands.
+ All of them open a connection to an LDAP server, bind, and perform one or more LDAP operations.
+
+ <table>
+ <title>Common command line tools</title>
+ <tgroup cols="2">
+ <colspec colnum="1" colname="col1" colwidth="1*"/>
+ <colspec colnum="2" colname="col2" colwidth="3*"/>
+ <thead>
+ <row>
+ <entry>Command</entry>
+ <entry>Short description from man page</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>ldapsearch</entry>
+ <entry>Performs a search using specified parameters.</entry>
+ </row>
+ <row>
+ <entry>ldapmodify and ldapadd</entry>
+ <entry>Modifies or adds entries. When invoked as ldapadd the -a (add new entry) flag is turned on automatically.</entry>
+ </row>
+ <row>
+ <entry>ldapmodrdn</entry>
+ <entry>Modifies the RDN of entries.</entry>
+ </row>
+ <row>
+ <entry>ldapdelete</entry>
+ <entry>Deletes one or more entries.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+
+ <para>
+ Open a shell and type "ldapsearch" to see whether these tools are already available on your system.
+ This may be true on UNIX systems, or LINUX systems (with OpenLDAP client tools installed).
+ If not (especially if you are using Windows, this is probably the case), you have different options to get such tools.
+ One is to download the Sun ONE Directory SDK for C, which is available for many platforms (among them Windows).
+ It also contains executables of the command line tools (ldapsearch etc.).
+ </para>
+ </section>
+
+ <section>
+ <title>A simple search example</title>
+ <para>
+ Here is an example for a search command, which displays the o=sevenSeas entry of our tutorial partition.
+ You will learn more about LDAP searches lateron.
+ </para>
+ <programlisting><![CDATA[
+$ ldapsearch -h zanzibar -p 10389 -b "o=sevenSeas" -D "uid=admin,ou=system" -w ****** "(objectClass=*)"
+o=sevenSeas
+description=Contains Apache Directory Tutorial example data
+objectClass=organization
+objectClass=top
+o=sevenSeas
+$
+ ]]></programlisting>
+
+ <para>
+ One big advantage of command line tools is that you can use them within scripts.
+ It is also much easier if you have to document changes to the directory (configuration, for instance).
+ Therfore administrators like them a lot.
+ We will use them within this tutorial as well, but always as an alternative to UI tools (which LDAP newbies normally prefer).
+ </para>
+
+ <important>
+ <title>Not all command line tools are equal</title>
+ <para>
+ Although the command line tools of different operating systems
+ and LDAP clients (shipped with LDAP servers) normally have the same name,
+ there are often differences in the command line options.
+ If any problems arise if you try out examples from this tutorial (e.g. "illegal option"),
+ consult the man pages or documentation of your tools.
+ </para>
+
+ </important>
+
+ </section>
+
+ <section>
+
+ <title>Import the sample data</title>
+
+ <para>
+ Here is an example usage of ldapmodify. It imports the sample data of this guide into an ApacheDS server,
+ which contains a sevenseas partition (which has been configured before).
+ </para>
+
+ <programlisting><![CDATA[
+$ ldapmodify -h zanzibar -p 10389 -D "uid=admin,ou=system" -w ****** -a -f apache_ds_tutorial.ldif
+adding new entry ou=people,o=sevenSeas
+adding new entry ou=groups,o=sevenSeas
+adding new entry ou=crews,ou=groups,o=sevenSeas
+adding new entry ou=ranks,ou=groups,o=sevenSeas
+adding new entry cn=Horatio Hornblower,ou=people,o=sevenSeas
+...
+adding new entry cn=John Fryer,ou=people,o=sevenSeas
+adding new entry cn=John Hallett,ou=people,o=sevenSeas
+adding new entry cn=HMS Bounty,ou=crews,ou=groups,o=sevenSeas
+$
+ ]]></programlisting>
+
+ <para>
+ The following table contains descriptions for the options used. See the manpage of ldapmodify for details.
+ <table>
+ <title>Command line options used in import example</title>
+ <tgroup cols="2">
+ <colspec colnum="1" colname="col1" colwidth="1*"/>
+ <colspec colnum="2" colname="col2" colwidth="2*"/>
+ <thead>
+ <row>
+ <entry>Option</entry>
+ <entry>Meaning</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>-h zanzibar</entry>
+ <entry>Hostname</entry>
+ </row>
+ <row>
+ <entry>-p 10389</entry>
+ <entry>Port</entry>
+ </row>
+ <row>
+ <entry>-D "uid=admin,ou=system"</entry>
+ <entry>Distinguished name to bind (user with appropriate privileges needed)</entry>
+ </row>
+ <row>
+ <entry>-w ******</entry>
+ <entry>Password of bind user</entry>
+ </row>
+ <row>
+ <entry>-a</entry>
+ <entry>add new entries</entry>
+ </row>
+ <row>
+ <entry>-f apache_ds_tutorial.ldif</entry>
+ <entry>Name of LDIF file to load</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+
+ <para>
+ The following operation demonstrates that your directory now contains the sample data.
+ It searches for all entries below o=sevenSeas (-b = search base, -s = search scope),
+ which have an attribute occurence of givenName with value "William".
+ The output contains the distinguished names (dn) of the result entries and their common name (cn) values.
+ </para>
+
+ <programlisting><![CDATA[
+$ ldapsearch -h zanzibar -p 10389 -D "uid=admin,ou=system" -w ****** -b "o=sevenSeas" -s sub "(givenName=William)" cn
+version: 1
+dn: cn=William Bligh,ou=people,o=sevenSeas
+cn: William Bligh
+
+dn: cn=William Bush,ou=people,o=sevenSeas
+cn: William Bush
+$
+ ]]></programlisting>
+
+ </section>
+
+ </section>
+
+ <section id="Connecting to a server Resources">
+ <title>Resources</title>
+ <itemizedlist>
+ <listitem>
+ <link xlink:href="http://www.sun.com/download/products.xml?id=3ec28dbd">Download</link>
+ Sun ONE Directory SDK for C, which contains the command line tools as well, for various platforms
+ </listitem>
+ </itemizedlist>
+ </section>
+
</section>