dsconfig-examples.xml revision 73adb2e3dbaa8a9f6448cefccb7933f68c3c7348
<?xml version="1.0" encoding="UTF-8"?>
<!--
! CDDL HEADER START
!
! The contents of this file are subject to the terms of the
! Common Development and Distribution License, Version 1.0 only
! (the "License"). You may not use this file except in compliance
! with the License.
!
! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
! or http://forgerock.org/license/CDDLv1.0.html.
! See the License for the specific language governing permissions
! and limitations under the License.
!
! When distributing Covered Code, include this CDDL HEADER in each
! file and include the License file at legal-notices/CDDLv1_0.txt.
! If applicable, add the following below this CDDL HEADER, with the
! fields enclosed by brackets "[]" replaced with your own identifying
! information:
! Portions Copyright [yyyy] [name of copyright owner]
!
! CDDL HEADER END
!
! Copyright 2015 ForgeRock AS.
!
-->
<refsect1 xmlns="http://docbook.org/ns/docbook"
version="5.0" xml:lang="en"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://docbook.org/ns/docbook
http://docbook.org/xml/5.0/xsd/docbook.xsd">
<title>Examples</title>
<para>
Much of the <citetitle>OpenDJ Administration Guide</citetitle>
consists of <command>dsconfig</command> examples with text in between.
This section therefore remains short.
</para>
<para>
The following example starts <command>dsconfig</command>
in interactive, menu-driven mode on the default port of the current host.
</para>
<screen>
$ <userinput>dsconfig -h opendj.example.com -p 4444 -D "cn=Directory Manager" -w password</userinput>
<computeroutput>
>>>> OpenDJ configuration console main menu
What do you want to configure?
1) Access Control Handler 23) Log Publisher
2) Access Log Filtering Criteria 24) Log Retention Policy
3) Account Status Notification Handler 25) Log Rotation Policy
4) Administration Connector 26) Matching Rule
5) Alert Handler 27) Monitor Provider
6) Attribute Syntax 28) Password Generator
7) Backend 29) Password Policy
8) Backend Index 30) Password Storage Scheme
9) Backend VLV Index 31) Password Validator
10) Certificate Mapper 32) Plugin
11) Connection Handler 33) Plugin Root
12) Crypto Manager 34) Replication Domain
13) Debug Target 35) Replication Server
14) Entry Cache 36) Root DN
15) Extended Operation Handler 37) Root DSE Backend
16) External Changelog Domain 38) SASL Mechanism Handler
17) Global Configuration 39) Schema Provider
18) Group Implementation 40) Synchronization Provider
19) Identity Mapper 41) Trust Manager Provider
20) Key Manager Provider 42) Virtual Attribute
21) Local DB Index 43) Work Queue
22) Local DB VLV Index
q) quit
Enter choice:</computeroutput>
</screen>
<para>
The following example demonstrates generating a batch file
that corresponds to an interactive session enabling the debug log.
The example then demonstrates using a modified batch file
to disable the debug log.
</para>
<screen>
$ <userinput>dsconfig \
--hostname opendj.example.com \
--port 4444 \
--bindDN "cn=Directory Manager" \
--bindPassword password \
--commandFilePath ~/enable-debug-log.batch</userinput>
...
$ <userinput>cat ~/enable-debug-log.batch</userinput>
<computeroutput># dsconfig session start date: 19/Oct/2011:08:52:22 +0000
# Session operation number: 1
# Operation date: 19/Oct/2011:08:55:06 +0000
dsconfig set-log-publisher-prop \
--publisher-name File-Based\ Debug\ Logger \
--set enabled:true \
--hostname opendj.example.com \
--port 4444 \
--trustStorePath /path/to/opendj/config/admin-truststore \
--bindDN cn=Directory\ Manager \
--bindPassword ****** \
--no-prompt</computeroutput>
$ <userinput>cp ~/enable-debug-log.batch ~/disable-debug-log.batch</userinput>
$ <userinput>vi ~/disable-debug-log.batch</userinput>
$ <userinput>cat ~/disable-debug-log.batch</userinput>
<computeroutput>set-log-publisher-prop \
--publisher-name File-Based\ Debug\ Logger \
--set enabled:false \
--hostname opendj.example.com \
--port 4444 \
--trustStorePath /path/to/opendj/config/admin-truststore \
--bindDN cn=Directory\ Manager \
--bindPassword password \
--no-prompt</computeroutput>
$ <userinput>dsconfig --batchFilePath ~/disable-debug-log.batch --no-prompt</userinput>
<computeroutput>set-log-publisher-prop
--publisher-name
File-Based Debug Logger
--set
enabled:false
--hostname
opendj.example.com
--port
4444
--trustStorePath
/path/to/opendj/config/admin-truststore
--bindDN
cn=Directory Manager
--bindPassword
password
--no-prompt</computeroutput>
$
</screen>
<para>
Notice that the original command file looks like a shell script
with the bind password value replaced by asterisks.
To pass the content as a batch file to <command>dsconfig</command>,
strip <literal>dsconfig</literal> itself,
and include the bind password for the administrative user
or replace that option with an alternative,
such as reading the password from a file.
</para>
</refsect1>