Este contenido no está disponible en el idioma seleccionado.
Chapter 3. 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.
3.1. Setting up a new instance on the command line using a .inf file Copiar enlaceEnlace copiado en el portapapeles!
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.
3.1.1. Prerequisites Copiar enlaceEnlace copiado en el portapapeles!
- The server meets the requirements of the latest Red Hat Directory Server version as described in the Red Hat Directory Server 13 Release Notes.
- You installed Directory Server packages as described in the Installing the Directory Server packages section.
3.1.2. Creating a .inf file for a Directory Server instance installation Copiar enlaceEnlace copiado en el portapapeles!
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.
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>.infThe 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>To configure the LMDB backend maximum size, set the following parameter:
mdb_max_size = 21474836480Note that
mdb_max_sizemust be an integer value that depends on your directory size. For more details, see nsslapd-mdb-max-size attribute description.Optional: To use the instance behind a load balancer with GSSAPI authentication, set the
full_machine_nameparameter in the[general]section to the fully-qualified domain name (FQDN) of the load balancer instead of the FQDN of the Directory Server host:full_machine_name = loadbalancer.example.comUncomment the
strict_host_checkingparameter in the[general]section and set it toFalse:strict_host_checking = FalseTo automatically create a suffix during instance creation, set the following parameters in the
[backend-userroot]section:create_suffix_entry = True suffix = dc=example,dc=comImportantIf you do not create a suffix during instance creation, you must create it later manually before you can store data on 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.
3.1.3. Using a .inf file to set up a new Directory Server instance Copiar enlaceEnlace copiado en el portapapeles!
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:# dscreate from-file /root/<instance_name>.inf Starting installation ... Validate installation settings ... Create file system structures ... Create self-signed certificate database ... Perform SELinux labeling ... Perform post-installation tasks ... Completed installation for instance: slapd-instance_nameThe
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}Reload the firewall configuration:
# firewall-cmd --reload
3.2. Setting up a new instance on the command line using the interactive installer Copiar enlaceEnlace copiado en el portapapeles!
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.
3.2.1. Prerequisites Copiar enlaceEnlace copiado en el portapapeles!
- The server meets the requirements of the latest Red Hat Directory Server version as described in the Red Hat Directory Server 13 Release Notes.
- You installed Directory Server packages as described in the Installing the Directory Server packages section.
3.2.2. Creating an instance using the interactive installer Copiar enlaceEnlace copiado en el portapapeles!
This section explains how to use the interactive installer to create a new Directory Server instance.
Procedure
Start the interactive installer:
# dscreate interactiveAnswer 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.
Install Directory Server (interactive mode) =========================================== Enter system's hostname [server.example.com]: Enter the instance name [server]: <instance_name> Enter port number [389]: Create self-signed certificate database [yes]: Enter secure port number [636]: Enter Directory Manager DN [cn=Directory Manager]: Enter the Directory Manager password: <password> Confirm the Directory Manager Password: <password> Choose whether mdb or bdb is used. [mdb]: Enter the lmdb database size [14.1 GB]: 10 G Enter the database suffix (or enter "none" to skip) [dc=server,dc=example,dc=com]: dc=example,dc=com Create sample entries in the suffix [no]: Create just the top suffix entry [no]: yes Do you want to start the instance after the installation? [yes]: Are you ready to install? [no]: yesNoteInstead 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==Open the required ports in the firewall:
# firewall-cmd --permanent --add-port={389/tcp,636/tcp}Reload the firewall configuration:
# firewall-cmd --reload
3.3. Setting up a new instance as a non-root user Copiar enlaceEnlace copiado en el portapapeles!
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:
- They do not support Simple Network Management Protocol (SNMP).
- They can use only ports higher or equal to 1024.
3.3.1. Preparing the environment to install Directory Server as a non-root user Copiar enlaceEnlace copiado en el portapapeles!
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"Re-read the
~/bash_profilefile:$ source ~/.bash_profile
Configure the environment for an instance creation to use the custom location:
$ dscreate ds-root $HOME/dsroot $HOME/binThis 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 dscreateVerify that the shell uses the correct path to the command:
$ which dscreate ~/bin/dscreateFor the
dscreatecommand, the shell now uses the$HOME/bin/dscreateinstead of/usr/bin/dscreate.
3.3.2. Installing a new instance as non-root user Copiar enlaceEnlace copiado en el portapapeles!
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 interactiveAnswer 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).
Install Directory Server (interactive mode) =========================================== Non privileged user cannot use semanage, will not relabel ports or files. Selinux support will be disabled, continue? [yes]: yes Enter system's hostname [server.example.com]: Enter the instance name [server]: <instance_name> Enter port number [389]: 1389 Create self-signed certificate database [yes]: Enter secure port number [636]: 1636 Enter Directory Manager DN [cn=Directory Manager]: Enter the Directory Manager password: <password> Confirm the Directory Manager Password: <password> Choose whether mdb or bdb is used. [mdb]: Enter the lmdb database size [14.1 GB]: 9 G Enter the database suffix (or enter "none" to skip) [dc=server,dc=example,dc=com]: dc=example,dc=com Create sample entries in the suffix [no]: Create just the top suffix entry [no]: yes Do you want to start the instance after the installation? [yes]: Are you ready to install? [no]: yesNoteInstead 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==
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}Reload the firewall configuration:
# sudo firewall-cmd --reload
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=*)"