OpenLDAP on Centos 6

yum install openldap-servers system-config-firewall-tui

sed -i “s/example/owncloudbook/g” olcDatabasse={2}bdb.ldif

openssl req -new -x509 -nodes -out /etc/pki/tls/certs/owncloud-cert.pem -keyout /etc/pki/tls/certs/owncloudbook.key.pem -days 3650

chown root:ldap /etc/pki/tls/certs/owncloudbook*

chmod 750 /etc/pki/tls/certs/owncloudbook*
echo << {olcDatabase={2}bdb.ldif EOF

olcTLSCertificateFile: /etc/pki/tls/certs/owncloudbook-cert.pem

olcTLSCertificateKeyFile: /etc/pki/tls/certs/owncloudbook-cert-key.pemsed -i /example/owncloudbook/g” olc

EOF

sed -i “s/example/owncloudbook/g” olcDatabase={1}monitor.ldif

cp /usr/share/openldap-servers/DB_CONF.example /var/lib/ldap/DB_CONFIG

chown -Rf  ldap:ldap /var/lib/ldap

vi /etc/sysconfig/ldap

SLAPD_LDAPS=yes

–> save and close

slaptest -u

services lapd start

TLS_CACERRT /etc/pki/tls/certs/owncloudbook-cert.pem

URI ldap://127.0.01

BASE dc=owncloud,dc=com

–> save and close

ldapsearch -x -b “dc=owncloudbook,dc=com”

 

groups.ldif and users.ldif

vi /etc/openldap/schema/base.ldif

dn: dc=owncloudbook,dc=com

dc: owncloudbook

objectClass: top

ocjbectClass: domain

dn: ou=Users,dc=owncloud,dc=com

ou: Users

objectClass: top

objectClass: organizationalUnit

dn: ou=Group, dc