1.9. Changing the LDAP and LDAPS Port Numbers
1.9. Changing the LDAP and LDAPS Port Numbers By default, Directory Server uses port 389 for the LDAP and, if enabled, port 636 for the LDAPS protocol. You can change these port numbers, for example, to run multiple Directory Server instances on one host. Important The new ports you assign to the protocols for an instance must not be in use by any other service. 1.9.1. Changing the Port Numbers Using the Command Line To change the port numbers using the command line, update the following parameters: nsslapd-port : Stores the port number the instance uses for the LDAP protocol. nsslapd-secureport : Stores the port number the instance uses for the LDAPS protocol. To change the port numbers of the LDAP and LDAPS protocol using the command line: Optionally, display the currently configured port numbers for the instance: To change the LDAP port: Set the port for the LDAP protocol. For example, to set it to 1389 : Set the ldap_port_t type for the LDAP port you assigned in the step: To change the LDAPS port: Set the port for the LDAPS protocol. For example, to set it to 1636 : Set the ldap_port_t type for the LDAPS port you assigned in the step: Restart the instance: 1.9.2. Changing the Port Numbers Using the Web Console To change the port numbers of the LDAP and LDAPS protocol using the web console: Open the Directory Server user interface in the web console. See Section 1.4, "Logging Into Directory Server Using the Web Console" . Select the instance. To change the LDAP port: Open the Server Settings menu. On the Server Settings tab, fill the new port number into the LDAP Port field. Click Save . To change the LDAPS port: Open the Server Settings menu. On the General Settings tab, fill the new port number into the LDAPS Port field. Click Save . Restart the instance. See Section 1.5.2, "Starting and Stopping a Directory Server Instance Using the Web Console" .
dsconf -D "cn=Directory Manager" ldap://server.example.com config get nsslapd-port nsslapd-secureport nsslapd-port: 389 nsslapd-secureport: 636 dsconf -D "cn=Directory Manager" ldap://server.example.com config replace nsslapd-port= 1389 Successfully replaced "nsslapd-port" semanage port -a -t ldap_port_t -p tcp 1389 dsconf -D "cn=Directory Manager" ldap://server.example.com config replace nsslapd-secureport= 1636 Successfully replaced "nsslapd-secureport" semanage port -a -t ldap_port_t -p tcp 1636 dsctl instance_name restart