-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.sh
26 lines (21 loc) · 911 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
yum install openldap-servers openldap-clients git -y &>/dev/null
cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
chown ldap. /var/lib/ldap/DB_CONFIG
systemctl start slapd
systemctl enable slapd
cd /opt
git clone https://github.com/submah/openldap.git &>/dev/null
[ $? -ne 0 ] && echo "Failed with pulling repo" && exit 1
cd /opt/openldap
ldapadd -Y EXTERNAL -H ldapi:/// -f chrootpw.ldif
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/cosine.ldif
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/nis.ldif
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/inetorgperson.ldif
ldapmodify -Y EXTERNAL -H ldapi:/// -f chdomain.ldif
ldapadd -x -D cn=Manager,dc=c4clouds,dc=com -W -f basedomain.ldif
yum install httpd php php-ldap -y &>/dev/null
cd /var/www/html
tar xf /opt/openldap/lam.tgz
systemctl restart httpd
systemctl enable httpd