Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 2. Setting up an instance using the command line
On the command line, you can use either a .inf file or interactive installer to set up a new instance. Additionally, you can set up a new instance as a non-root user.
2.1. Prerequisites Link kopierenLink in die Zwischenablage kopiert!
- The server meets the requirements of the latest Red Hat Directory Server version as described in the Red Hat Directory Server 12 Release Notes
2.2. Setting up a new instance on the command line using a .inf file Link kopierenLink in die Zwischenablage kopiert!
When you set up Directory Server using a .inf file on the command line you can customize advanced settings. For example, you can customize in the .inf file the following settings:
-
The user and group the
ns-slapdDirectory Server process uses after the service has started. Note that, if you use a different user and group, you must manually create the user and group before you start the installation. - Paths, such as the configuration, backup, and data directory.
- Certificate validity.
2.2.1. Installing the Directory Server packages Link kopierenLink in die Zwischenablage kopiert!
Use the following procedure to install the Directory Server packages.
Prerequisites
- You enabled RHEL and Directory Server repositories as described in Enabling Directory Server repositories.
Procedure
Enable the
redhat-ds:12module and install Directory Server packages:dnf module enable redhat-ds:12 dnf install 389-ds-base cockpit-389-ds
# dnf module enable redhat-ds:12 # dnf install 389-ds-base cockpit-389-dsCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2.2. Creating a .inf file for a Directory Server instance installation Link kopierenLink in die Zwischenablage kopiert!
Create a .inf file for the dscreate utility, and adjust the file to your environment. In a later step, you will use this file to create the new Directory Server instance.
Prerequisites
-
You installed the
redhat-ds:12module.
Procedure
Use the
dscreate create-templatecommand to create a template.inffile. For example, to store the template in the/root/instance_name.inffile, enter:dscreate create-template /root/instance_name.inf
# dscreate create-template /root/instance_name.infCopy to Clipboard Copied! Toggle word wrap Toggle overflow The created file contains all available parameters including descriptions.
Edit the file that you created in the previous step:
Uncomment the parameters that you want to set to customize the installation.
All parameters have defaults. However, customize certain parameters for a production environment. For example, set at least the following parameters in the
[slapd]section:instance_name = instance_name root_password = password
instance_name = instance_name root_password = passwordCopy to Clipboard Copied! Toggle word wrap Toggle overflow By default, Directory Server creates an instance with the Berkeley Database (BDB). To install an instance with the LMDB backend that is a Technology Preview starting with Directory Server 12.5, set the following parameters:
db_lib = mdb mdb_max_size = 21474836480
db_lib = mdb mdb_max_size = 21474836480Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note that
mdb_max_sizemust be an integer value that depends on your directory size. For more details, see nsslapd-mdb-max-size attribute description.To automatically create a suffix during instance creation, set the following parameters in the
[backend-userroot]section:create_suffix_entry = True suffix = dc=example,dc=com
create_suffix_entry = True suffix = dc=example,dc=comCopy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantIf you do not create a suffix during instance creation, you must create it later manually before you can store data in this instance.
Optional: Uncomment other parameters and set them to appropriate values for your environment. For example, use these parameters to specify replication options, such as authentication credentials and changelog trimming, or set different ports for the LDAP and LDAPS protocols.
NoteBy default, new instances that you create include a self-signed certificate and TLS enabled. For increased security, do not disable this feature. Note that you can replace the self-signed certificate with a certificate issued by a Certificate Authority (CA) at a later date.
2.2.3. Using a .inf file to set up a new Directory Server instance Link kopierenLink in die Zwischenablage kopiert!
This section describes how to use a .inf file to set up a new Directory Server instance using the command line.
Prerequisites
-
You created a
.inffile for the Directory Server instance.
Procedure
Pass the
.inffile to thedscreate from-filecommand to create the new instance:Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
dscreateutility automatically starts the instance and configures RHEL to start the service when the system boots.Open the required ports in the firewall:
firewall-cmd --permanent --add-port={389/tcp,636/tcp}# firewall-cmd --permanent --add-port={389/tcp,636/tcp}Copy to Clipboard Copied! Toggle word wrap Toggle overflow Reload the firewall configuration:
firewall-cmd --reload
# firewall-cmd --reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.3. Setting up a new instance on the command line using the interactive installer Link kopierenLink in die Zwischenablage kopiert!
Administrators can use the Directory Server interactive installer to set up a new instance by answering questions about the configuration for the new instance.
If you want to customize additional settings during the installation, use a .inf file instead of the interactive installer. For details, see Setting up a new instance on the command line using a .inf file.
2.3.1. Prerequisites Link kopierenLink in die Zwischenablage kopiert!
- The server meets the requirements of the latest Red Hat Directory Server version as described in the Red Hat Directory Server 12 Release Notes.
2.3.2. Installing the Directory Server packages Link kopierenLink in die Zwischenablage kopiert!
Use the following procedure to install the Directory Server packages.
Prerequisites
- You enabled RHEL and Directory Server repositories as described in Enabling Directory Server repositories.
Procedure
Enable the
redhat-ds:12module and install Directory Server packages:dnf module enable redhat-ds:12 dnf install 389-ds-base cockpit-389-ds
# dnf module enable redhat-ds:12 # dnf install 389-ds-base cockpit-389-dsCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.3.3. Creating an instance using the interactive installer Link kopierenLink in die Zwischenablage kopiert!
This section explains how to use the interactive installer to create a new Directory Server instance.
Procedure
Start the interactive installer:
dscreate interactive
# dscreate interactiveCopy to Clipboard Copied! Toggle word wrap Toggle overflow Answer the questions of the interactive installer.
To use the default values displayed in square brackets behind most questions in the installer, press Enter without entering a value.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteBy default, Directory Server creates an instance with the Berkeley Database (BDB). To install an LMDB instance that is a Technology Preview starting with Directory Server 12.5, set
mdband, on the next step, set the LMDB database size in bytes.Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteInstead of setting a password in clear text you can set a
{algorithm}hashstring generated by thepwdhashutility. For example:Enter the Directory Manager password: {PBKDF2-SHA512}100000$Haw7UDcBKUBejEjOTVHbiefT6cokHLo2$PeoP7W3B92Jzby7DGRkicovTN4LDGhnsC4EWCsv6crA2KA0Xn6rxPePX9UXhlM2utOPSQHeVpZzscNTx+fGi7A==Enter the Directory Manager password: {PBKDF2-SHA512}100000$Haw7UDcBKUBejEjOTVHbiefT6cokHLo2$PeoP7W3B92Jzby7DGRkicovTN4LDGhnsC4EWCsv6crA2KA0Xn6rxPePX9UXhlM2utOPSQHeVpZzscNTx+fGi7A==Copy to Clipboard Copied! Toggle word wrap Toggle overflow Open the required ports in the firewall:
firewall-cmd --permanent --add-port={389/tcp,636/tcp}# firewall-cmd --permanent --add-port={389/tcp,636/tcp}Copy to Clipboard Copied! Toggle word wrap Toggle overflow Reload the firewall configuration:
firewall-cmd --reload
# firewall-cmd --reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.4. Setting up a new instance as a non-root user Link kopierenLink in die Zwischenablage kopiert!
If you do not have root permissions, you can perform the Directory Server installation as a non-root user. Use this method to test Directory Server and develop LDAP applications. However, note that instances running by a non-root user have limitations, such as:
- They do not support Simple Network Management Protocol (SNMP).
- They can use only ports higher or equal to 1024.
2.4.1. Preparing the environment to install Directory Server as a non-root user Link kopierenLink in die Zwischenablage kopiert!
As a non-root user, before you can create and administer Directory Server instances, you need to prepare a proper environment by using the dscreate ds-root command.
Prerequisites
-
You installed the Directory Server packages as a
rootuser.
Procedure
Ensure you have
$HOME/binin your PATH variable. If not:Append the following to the
~/.bash_profilefile:PATH="$HOME/bin:$PATH"
PATH="$HOME/bin:$PATH"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Re-read the
~/bash_profilefile:source ~/.bash_profile
$ source ~/.bash_profileCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Configure the environment for an instance creation to use the custom location:
dscreate ds-root $HOME/dsroot $HOME/bin
$ dscreate ds-root $HOME/dsroot $HOME/binCopy to Clipboard Copied! Toggle word wrap Toggle overflow This command replaces the standard installation paths with
$HOME/dsroot/and creates a copy of the standard Directory Server administration utilities in the$HOME/bin/directory.To make the shell use new paths:
Clear the cache:
hash -r dscreate
$ hash -r dscreateCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the shell uses the correct path to the command:
which dscreate
$ which dscreate ~/bin/dscreateCopy to Clipboard Copied! Toggle word wrap Toggle overflow
For the dscreate command, the shell now uses the $HOME/bin/dscreate instead of /usr/bin/dscreate.
2.4.2. Installing a new instance as non-root user Link kopierenLink in die Zwischenablage kopiert!
To install Directory Server without root permissions, you can use the interactive installer. After the installation, Directory Server creates an instance in the custom location and a user can run dscreate, dsctl, dsconf utilities as usual.
Prerequisites
- You prepared the environment for non-root installation.
-
You have
sudopermissions to use thefirewall-cmdutility If you want to make the Directory Server instance available from the outside.
Procedure
Create an instance using the interactive installer
Start the interactive installer:
dscreate interactive
$ dscreate interactiveCopy to Clipboard Copied! Toggle word wrap Toggle overflow Answer the questions of the interactive installer.
To use the default values displayed in square brackets behind most questions in the installer, press Enter without entering a value.
NoteDuring the installation, you must choose the instance port and secure port number higher than 1024 (for example, 1389 and 1636). Otherwise, a user does not have permissions to bind to a privileged port (1-1023).
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteBy default, Directory Server creates an instance with the Berkeley Database (BDB). To install an LMDB instance that is a Technology Preview starting with Directory Server 12.5, set
mdband, on the next step, set the LMDB database size in bytes.Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteInstead of setting a password in clear text you can set a
{algorithm}hashstring generated by thepwdhashutility. For example:Enter the Directory Manager password: {PBKDF2-SHA512}100000$Haw7UDcBKUBejEjOTVHbiefT6cokHLo2$PeoP7W3B92Jzby7DGRkicovTN4LDGhnsC4EWCsv6crA2KA0Xn6rxPePX9UXhlM2utOPSQHeVpZzscNTx+fGi7A==Enter the Directory Manager password: {PBKDF2-SHA512}100000$Haw7UDcBKUBejEjOTVHbiefT6cokHLo2$PeoP7W3B92Jzby7DGRkicovTN4LDGhnsC4EWCsv6crA2KA0Xn6rxPePX9UXhlM2utOPSQHeVpZzscNTx+fGi7A==Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Optional: If you want to make the Directory Server instance available from the outside:
Open the ports in the firewall:
sudo firewall-cmd --permanent --add-port={1389/tcp,1636/tcp}# sudo firewall-cmd --permanent --add-port={1389/tcp,1636/tcp}Copy to Clipboard Copied! Toggle word wrap Toggle overflow Reload the firewall configuration:
sudo firewall-cmd --reload
# sudo firewall-cmd --reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Run
ldapsearchcommand to test that a user can connect to the instance:ldapsearch -D "cn=Directory Manager" -W -H ldap://server.example.com:1389 -b "dc=example,dc=com" -s sub -x "(objectclass=*)"
$ ldapsearch -D "cn=Directory Manager" -W -H ldap://server.example.com:1389 -b "dc=example,dc=com" -s sub -x "(objectclass=*)"Copy to Clipboard Copied! Toggle word wrap Toggle overflow