red hat6.2下安装openldap2.4.39

redhat6.2上安装openldap2.4.39(基于源码安装)
1、先下载openldap-2.4.39.tgz
2、将 openldap-2.4.39.tgz上传至 /usr/local目录
3、解压缩 openldap-2.4.39.tgz
cd /usr/local
tar -zxvpf  openldap-2.4.39.tgz
cd  openldap-2.4.39
./configure --prefix=/usr/local/openldap --enable-ldbm
make depend
make
make test
make install
启动openldap,测试是否能启动成功
/usr/local/openldap/libexec/slapd -d 256
/usr/local/openldap/bin/ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts 
/usr/local/openldap/bin/ldapsearch -h localhost "objectClass=*"
 
配置openldap,增加你自己的schema
#配置文件目录:/usr/local/openldap/etc/openldap/slapd.conf
#schema顺序:
include  /usr/local/openldap/etc/openldap/schema/core.schema
include  /usr/local/openldap/etc/openldap/schema/corba.schema 
include  /usr/local/openldap/etc/openldap/schema/cosine.schema 
include  /usr/local/openldap/etc/openldap/schema/inetorgperson.schema 
include  /usr/local/openldap/etc/openldap/schema/misc.schema 
include  /usr/local/openldap/etc/openldap/schema/openldap.schema 
include  /usr/local/openldap/etc/openldap/schema/nis.schema 
include  /usr/local/openldap/etc/openldap/schema/你自己的.schema
修改:suffix  "你自己的suffix"
修改: rootdn  "你自己的rootdn"
 
重启openldap,添加数据
/usr/local/openldap/libexec/slapd -d 256
#添加内容
/usr/local/openldap/bin/ldapadd -x -D "你自己的rootdn" -W -f /qingfeng_setup/2.4.23_linux/XX.ldif
ldapadd -x -D "cn=admin,dc=szeg,dc=gov" -w 123456 -f new.ldif

你可能感兴趣的:(openLdap)