rhel5.3 +openldap+phpldapadmin
[[email protected] ~]# yum install httpd -y
[[email protected] ~]# yum install php -y
[[email protected] ~]# yum install php-ldap –y
[[email protected] ~]# yum install openldap-servers -y
此处密码也可使用明文,但建议使用加密方式的密码,通过slappassword –s 密码,创建加密密码,如下图:
以下部分也可以略过,如果你不需要导入系统账号的话。
[[email protected] ~]# vi users.list
user1 123456
user2 123456
user3 123456
user4 123456
user5 123456
user6 123456
user7 123456
[[email protected] ~]# cd /usr/share/openldap/migration/
[[email protected] ~]# vi user-add.sh
#!/bin/bash
for i in `awk '{print $1}' users.list`
do
useradd $i
grep "\<$i\>" users.list | awk '{print $2}' | passwd --stdin $i
done
[[email protected] ~]# chmod +x user-add.sh
[[email protected] ~]# sh user-add.sh
[[email protected] migration]# sed -n '/\<user.\>/p' /etc/passwd
[[email protected] migration]# cd /usr/share/openldap/migration/
[[email protected] migration]# ./migrate_passwd.pl ~/ldappasswd > ~/users.ldif
[[email protected] migration]# ./migrate_group.pl ~/ldapgroup > ~/group.ldif
[[email protected] ~]# cp /etc/openldap/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
[[email protected] ~]# chown ldap.ldap /var/lib/ldap/*
[[email protected] ~]# ldapsearch -x -b "dc=simp,dc=com"
客户端
[[email protected] ~]# authconfig-tui
服务器端
[[email protected] ~]# vi /etc/exports
/home/ *(async,rw)
[[email protected] ~]# /etc/init.d/nfs restart
客户端
安装
[[email protected] ~]# tar -zxvf phpldapadmin-1.1.0.7.tar.gz -C /usr/local/src/
[[email protected] ~]# cd /usr/local/src/
[[email protected] src]# cp -a phpldapadmin-1.1.0.7 /var/www/html/ldap
[[email protected] src]# cd /var/www/html/ldap/
http://192.168.10.4/ldap/htdocs/index.php
[[email protected] config]# cd /var/www/html/ldap/config/
[[email protected] config]# mv config.php.example config.php
刷新网页
[[email protected] config]# vi /etc/php.ini
将memory_limit = 16M 改为32M,重启apache
刷新网页
转载于:https://blog.51cto.com/itchen/168890