Line 28:
Line 28:
Modify file '''slapd.conf''' also to add includes of schemas you will need to declare your LDAP objects.
Modify file '''slapd.conf''' also to add includes of schemas you will need to declare your LDAP objects.
−
<source lang="ini">
+
<syntaxHighlight lang="ini">
include ./schema/core.schema
include ./schema/core.schema
include ./schema/cosine.schema
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/inetorgperson.schema
include ./schema/nis.schema
include ./schema/nis.schema
−
</source>
+
</syntaxHighlight>
or add shemas with
or add shemas with
−
<source lang="ini">
+
<syntaxHighlight lang="ini">
sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/cosine.ldif
sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/cosine.ldif
sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/nis.ldif
sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/nis.ldif
sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/inetorgperson.ldif
sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/inetorgperson.ldif
−
</source>
+
</syntaxHighlight>
Restart the service.
Restart the service.
Line 58:
Line 58:
Execute file using the LDAP admin user:
Execute file using the LDAP admin user:
−
<source lang="bash">
+
<syntaxHighlight lang="bash">
ldapadd -f init.ldif -D "cn=admin,dc=mydomain,dc=com" -w secret
ldapadd -f init.ldif -D "cn=admin,dc=mydomain,dc=com" -w secret
−
</source>
+
</syntaxHighlight>
= Create few users =
= Create few users =
Create a file inituser.ldif with your organization. For example (take care to keep empty line between each block):
Create a file inituser.ldif with your organization. For example (take care to keep empty line between each block):
−
<source lang="ini">
+
<syntaxHighlight lang="ini">
# Some User
# Some User
dn: sn=someuser,ou=mypeople,dc=nodomain
dn: sn=someuser,ou=mypeople,dc=nodomain
Line 76:
Line 76:
mail: someuser@nodomain
mail: someuser@nodomain
userPassword: {SSHA}hnP4gNK7SbgsAW3eTZYf23a4R7Ob19l2
userPassword: {SSHA}hnP4gNK7SbgsAW3eTZYf23a4R7Ob19l2
−
</source>
+
</syntaxHighlight>
Use '''slappasswd -s passwordtocrypt''' to generate a password.
Use '''slappasswd -s passwordtocrypt''' to generate a password.
Line 85:
Line 85:
To confirm problem, go onto DOS under directory data of OpenLDAP and launch command
To confirm problem, go onto DOS under directory data of OpenLDAP and launch command
−
<source lang="bash">
+
<syntaxHighlight lang="bash">
..\db_stat -e
..\db_stat -e
−
</source>
+
</syntaxHighlight>
If message is the one described, launch repare of base with
If message is the one described, launch repare of base with
−
<source lang="bash">
+
<syntaxHighlight lang="bash">
..\db_recover
..\db_recover
−
</source>
+
</syntaxHighlight>
Server should be able to start again.
Server should be able to start again.