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:
# dsconf -D "cn=Directory Manager" ldap://server.example.com config get nsslapd-port nsslapd-secureport nsslapd-port: 389 nsslapd-secureport: 636
- To change the LDAP port:
- Set the port for the LDAP protocol. For example, to set it to
1389
:# dsconf -D "cn=Directory Manager" ldap://server.example.com config replace nsslapd-port=1389 Successfully replaced "nsslapd-port"
- Set the
ldap_port_t
type for the LDAP port you assigned in the previous step:# semanage port -a -t ldap_port_t -p tcp 1389
- To change the LDAPS port:
- Set the port for the LDAPS protocol. For example, to set it to
1636
:# dsconf -D "cn=Directory Manager" ldap://server.example.com config replace nsslapd-secureport=1636 Successfully replaced "nsslapd-secureport"
- Set the
ldap_port_t
type for the LDAPS port you assigned in the previous step:# semanage port -a -t ldap_port_t -p tcp 1636
- Restart the instance:
# dsctl instance_name restart
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 themenu.
- On the Server Settings tab, fill the new port number into the LDAP Port field.
- Click.
- To change the LDAPS port:
- Open themenu.
- On the General Settings tab, fill the new port number into the LDAPS Port field.
- Click.
- Restart the instance. See Section 1.5.2, “Starting and Stopping a Directory Server Instance Using the Web Console”.