- setenforce 0
- systemctl stop firewalld.service
- systemctl disable firewalld.service
yum install -y openldap-servers openldap-clients migrationtools vim wget bzip2
- slappasswd
- 然后根据提示输入密码:
- New password: 123456
- Re-enter new password: 123456
- 会返回加密的密码字符串,保存好这个字符串
- {SSHA}ySgApuXKV01RHCgMDFx4yQjNquUzyLlj
- vim /etc/openldap/slapd.d/cn\=config\/olcDatabase\={2}hdb.ldif
- 找到olcSuffix,修改为你的dc,如:
- dc=sol,dc=com
- 下一行olcRootDN, 修改为你的用户名,如:
- cn=root,dc=sol,dc=com
- 在文件末尾添加一行,设置刚才的密码:
- olcRootPW: {SSHA}U5wSSZtqOvup3HMLC+tkg32COeuBvpav
- vim /etc/openldap/slapd.d/cn\=config\/olcDatabase\={1}monitor.ldif
- 修改 olcAccess 中的dn.base=”cn=xxxxxxx”这行为刚才设置的用户名,如:
- dn.base=”cn=root,dc=sol,dc=com
- cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
- chown -R ldap:ldap /var/lib/ldap/
- slaptest -u
- 末尾出现configfile testing successed 说明成功了
- systemctl start slapd.service
- systemctl enable slapd.service
ls /etc/openldap/schema/*.ldif | xargs -I {} sudo ldapadd -Y EXTERNAL -H ldapi:/// -f {}
在/etc/openldap目录下添加base.ldif文件
- cd /etc/openldap/
- vim base.ldif
- dn: dc=sol,dc=com
- o: ldap
- objectclass: dcObject
- objectclass: organization
- dn: cn=root,dc=sol,dc=com
- objectclass: organizationalRole
- cn: root
- (dc 修改为你自己的内容)
注意:每一行的结尾不要留空格
- ldapadd -f base.ldif -x -w 123456 -D cn=root,dc=sol,dc=com
- //-w 后面就是之前设置的密码,版主的密码是123456,根据自己的填写
- yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
- yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y install yum-utils
yum remove php*
- yum-config-manager --enable remi-php73
- yum -y install php php-fpm php-mysqlnd php-zip php-devel php-gd php-redis php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json php-pdo php-pecl-apcu php-pecl-apcu-devel php-ldap php-gmp
- service php-fpm start
- php -v
yum install httpd -y
- systemctl start httpd
- systemctl enable httpd
- systemctl status httpd
LDAP Account Manager官方地址:LDAP Account Manager
Download ldap-account-manager-7.4.tar.bz2 (LDAP Account Manager)
将 ?download 删除
wget http://prdownloads.sourceforge.net/lam/ldap-account-manager-7.4.tar.bz2
- tar jxf ldap-account-manager-7.4.tar.bz2
- mv ldap-account-manager-7.4 /var/www/html/ldap
- cd /var/www/html/ldap/config
- cp config.cfg.sample config.cfg
- cp unix.sample.conf lam.conf
- sed -i "s/dc=my-domain,dc=com/dc=sol,dc=com/g" lam.conf
- sed -i "s/cn=Manager/cn=root/g" lam.conf
- sed -i "s/dc=yourdomain,dc=org/dc=sol,dc=com/g" lam.conf
- sed -i "s#ServerURL: ldap://localhost:389#ServerURL: ldap://自己服务器的ip:389#g" lam.conf
chown -R apache.apache /var/www/html/ldap/
- systemctl restart httpd
- systemctl restart php-fpm
http://ip/ldap
输入创建的密码:123456
联系客服