转载 LDAP Schema Design
这里有个 LDAP Schema Design , 最基本的一个自定义 Schema ,就 几个 attributetype + objectClass http://networking.ittoolbox.com/pub/AR103103.pdf
这里是 OpenLDAP 2.2.29 ,支持 安装 WinNT Service
http://download.bergmans.us/openldap/openldap-2.2.29/openldap-2.2.29-db-4.3.29-openssl-0.9.8a-win32_Setup.exe
修改一下 slapd.conf
ucdata-path ./ucdata
include ./schema/core.schema
include ./schema/corba.schema
include ./schema/cosine.schema
include ./schema/dyngroup.schema
include ./schema/inetorgperson.schema
include ./schema/java.schema
include ./schema/misc.schema
include ./schema/nis.schema
include ./schema/openldap.schema
include ./schema/jmx.schema
access to dn.base=""
by * read
access to dn.base="cn=Subschema"
by * read
access to dn.base="dc=roles,o=atreides.vicp.net"
by * read
by dn.base="dc=j2ee,o=atreides.vicp.net" read
access to attr=userPassword
by self write
by * auth
access to attr=mail
by self write
by dn.base="dc=j2ee,o=atreides.vicp.net" read
access to *
by self write
by users read
by anonymous auth
database bdb
suffix "o=atreides.vicp.net"
rootdn "uid=root,o=atreides.vicp.net"
rootpw {SHA}zawrfGLVPmYCZTwZdKkSzPxPrcs=
初始化 LDAP 数据库,比如 以下的内容放到一个 .ldif 文件中,
然后 ldapadd -DN "$ROOT_DN" -w $ROOT_PASSWORD -f $FILENAME.ldif
dn: o=atreides.vicp.net
objectClass: organization
objectClass: dcObject
o: atreides.vicp.net
dc: atreides.vicp.net
dn: dc=users,o=atreides.vicp.net
objectClass: dcObject
objectClass: organizationalUnit
objectClass: top
ou:users
dc:users
dn: dc=j2ee,o=atreides.vicp.net
objectClass: dcObject
objectClass: organizationalUnit
objectClass: top
dc:j2ee
ou:j2ee
dn: dc=roles,o=atreides.vicp.net
objectClass: dcObject
objectClass: organizationalUnit
objectClass: top
dc:roles
ou:roles
dn: uid=tomcat,dc=j2ee,o=atreides.vicp.net
objectClass: inetOrgPerson
uid:tomcat
userPassword: {SHA}CeoBx7P8BjRod9RtfuvF63piKE8=
cn:tomcat
sn:j2ee
ou:j2ee
dn: uid=manager,dc=j2ee,o=atreides.vicp.net
objectClass: inetOrgPerson
uid:manager
userPassword: {SHA}SFE4AUuhSO3T4+/Pyk3fH1WpkyU=
cn:manager
sn:j2ee
ou:j2ee
dn: cn=tomcat,dc=roles,o=atreides.vicp.net
objectClass: organizationalRole
cn:tomcat
roleOccupant: cn=admin,cn=tomcat,dc=roles,o=atreides.vicp.net
roleOccupant: cn=manager,cn=tomcat,dc=roles,o=atreides.vicp.net
dn: cn=admin,cn=tomcat,dc=roles,o=atreides.vicp.net
objectClass: organizationalRole
cn:admin
roleOccupant: uid=tomcat,dc=j2ee,o=atreides.vicp.net
dn: cn=manager,cn=tomcat,dc=roles,o=atreides.vicp.net
objectClass: organizationalRole
cn:manager
roleOccupant: uid=tomcat,dc=j2ee,o=atreides.vicp.net