1. 使用yum安裝openldap-servers(slapd)和openldap-client(ldap)
yum install openldap-servers openldap-clients
2. 編輯or產生/etc/openldap/ldap.conf
vi /etc/openldap/ldap.conf
URI ldap://127.0.0.1
BASE dc=my-domain,dc=com
3. 複製slapd.conf和DB_CONFIG
cp /usr/share/openldap-servers/slapd.conf.obsolete /etc/openldap/slapd.conf
cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
4. slappasswd
打上欲設定的ldap server密碼,將最後一行{SSHA}xxxxxxxxx複製起來
5.編輯/etc/openldap/slapd.conf
把裡面的dc=my-domain,dc=com改成自己要的
在rootpw的地方把剛剛複製的{SSHA}xxxxx貼上去
6.建立一root.ldif檔,內容
objectClass: organizationalUnit |
7. 先把slapd.d裡的資料移除
rm -rf /etc/openldap/slapd.d/*
8. 使用slaptest將slpad.conf轉成slapd.d/
slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d
9. 改變檔案權限及擁有者
chown -R ldap:ldap /var/lib/ldap
chown -R ldap:ldap /etc/openldap/slapd.d
10.將slapd設為system boot up自動啟動
chkconfig slapd on
11.啟動slapd
service slapd start
12. 登入Webmin的LDAP Users and Groups (config要設好)
LDAP server uses encryption? -> Yes SSL
Bind to LDAP server as -> cn=Manager,dc=my-domain,dc=com