wwh@Ldap:/etc/ldap$ sudo vi base.ldif
-----------base.ldif內容------------------------------------------------------------------
# create new
# change to your own suffix for the field 'dc=lnes,dc=tp,dc=edu,dc=tw'
dn: ou=people,dc=lnes,dc=tp,dc=edu,dc=tw
objectClass: organizationalUnit
ou: people
dn: ou=teachers,dc=lnes,dc=tp,dc=edu,dc=tw
objectClass: organizationalUnit
ou: teachers
dn: ou=s100,dc=lnes,dc=tp,dc=edu,dc=tw
objectClass: organizationalUnit
ou: s100
dn: ou=s101,dc=lnes,dc=tp,dc=edu,dc=tw
objectClass: organizationalUnit
ou: s101
dn: ou=s102,dc=lnes,dc=tp,dc=edu,dc=tw
objectClass: organizationalUnit
ou: s102
dn: ou=s103,dc=lnes,dc=tp,dc=edu,dc=tw
objectClass: organizationalUnit
ou: s103
-----------base.ldif結束------------------------------------------------------------------
以下這一段是將base.ldif的檔案內容,將一些群組(people,teachers,s100,s101,s102,s103)加入伺服器
wwh@Ldap:/etc/ldap$ ldapadd -x -D cn=admin,dc=lnes,dc=tp,dc=edu,dc=tw -W -f base.ldif
Enter LDAP Password:
adding new entry "ou=people,dc=lnes,dc=tp,dc=edu,dc=tw"
adding new entry "ou=teachers,dc=lnes,dc=tp,dc=edu,dc=tw"
adding new entry "ou=s100,dc=lnes,dc=tp,dc=edu,dc=tw"
adding new entry "ou=s101,dc=lnes,dc=tp,dc=edu,dc=tw"
adding new entry "ou=s102,dc=lnes,dc=tp,dc=edu,dc=tw"
adding new entry "ou=s103,dc=lnes,dc=tp,dc=edu,dc=tw"
wwh@Ldap:/etc/phpldapadmin$ sudo vi config.php
-----------config.php內容------------------------------------------------------------------
將前面的註釋去掉。
$servers->setValue('server','host','127.0.0.1');
$servers->setValue('server','port',389);
修改: 在array中輸入設置的olcSuffix。
$servers->setValue('server','base',array(''));
$servers->setValue('server','base',array('dc=lnes,dc=tp,dc=edu,dc=tw'));
將前面的註釋去掉。
$servers->setValue('login','auth_type','session');
-----------config.php結束-----------------------------------------------------
沒有留言:
張貼留言