LDAP can be used for unified user management and Svn, Apache, and Linux users.
yum install openldap-servers openldap-clientsyum install perl-LDAP*
After the installation is complete, edit LDAP. conf
VI/etc/OpenLDAP/ldap. conf # modify the following content: uri ldap: // 127.0.0.1base Dc = My-domain, Dc = com
Initialize the database:
cp /usr/share/openldap-servers/slapd.conf.obsolete /etc/openldap/slapd.confcp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
Configure slapd. conf:
suffix "dc=my-domain,dc=com"checkpoint 1024 15rootdn "cn=Manager,dc=my-domain,dc=com"rootpw {SSHA}F8npd/kNMfH+QWBejiw+hnvYhGVbW6p6
The rootpw can be generated by the command.
Note: Do not use spaces in the file to change the password. You can separate them with tabs. Otherwise, the password is incorrect.
Modify directory permissions:
chown -R ldap:ldap /var/lib/ldapchown -R ldap:ldap /etc/openldap/slapd.d
Import the configuration file (for future changes, refer to this step)
rm -rf /etc/openldap/slapd.d/*slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.dchown -R ldap:ldap /etc/openldap/slapd.dservice slapd restart
Import initial value:
# vim init.ldifdn :dc=my-domain,dc=comobjectclass :dcObjectobjectclass :organizationo :my-domain Cop.dc :my-domaindn :cn=Manager,dc=my-domain,dc=comobjectclass :organizationalRolecn :Manager
Import (enter the password of the manager, that is, the rootpw in the preceding step ):
ldapadd -x -D cn=Manager,dc=my-domain,dc=com -W -f init.ldif
Then, you can install phpldapadmin or LDAP account manager for management. You can use rpm for installation.
Centos: OpenLDAP Configuration