Skip to content

Creating DS Backend

Endi S. Dewata edited this page Apr 24, 2023 · 1 revision

Creating Backend Instance

To create a backend instance (e.g. pki) for a subtree (e.g. dc=pki,dc=example,dc=com), execute the following command:

$ ldapadd -H ldap://$HOSTNAME -x -D "cn=Directory Manager" -w Secret.123 << EOF
dn: cn=pki,cn=ldbm database,cn=plugins,cn=config
objectClass: top
objectClass: nsBackendInstance
objectClass: extensibleObject
cn: pki
nsslapd-suffix: dc=pki,dc=example,dc=com
EOF

Creating Mapping Tree

To map a subtree (e.g. dc=pki,dc=example,dc=com) to a backend (e.g. pki), execute the following command:

$ ldapadd -H ldap://$HOSTNAME -x -D "cn=Directory Manager" -w Secret.123 << EOF
dn: cn="dc=pki,dc=example,dc=com",cn=mapping tree,cn=config
objectClass: top
objectClass: extensibleObject
objectClass: nsMappingTree
cn: dc=pki,dc=example,dc=com
nsslapd-backend: pki
nsslapd-state: backend
EOF

Adding Top-level Entry

To add the top-level entry (e.g. dc=pki,dc=example,dc=com), execute the following command:

$ ldapadd -H ldap://$HOSTNAME -x -D "cn=Directory Manager" -w Secret.123 << EOF
dn: dc=pki,dc=example,dc=com
objectClass: domain
dc: pki
EOF