SummaryPRoblem and resolveno DB_CONFIG filedb_openvarlibldapid2entrybdb failed No such file or directory 2Permission denied for etcopenldapslapddcnconfigldifSuccessful resultReference
Summary
Encountered quite a few problems when configure LDAP simple server on RHEL6, resolved all the issues through the internet. Refer to the reference link for more detail.
Problem and resolve
no DB_CONFIG file
bdb_db_open: warning - no DB_CONFIG file found in directory /var/lib/ldap: (2).
By copy the DB file to the relative folder, solved this issue.
[root@www openldap]# rm -rf /etc/openldap/slapd.d/*[root@www openldap]# ls /etc/openldap/slapd.d/[root@www openldap]# cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG[root@www openldap]# chown -R ldap:ldap /var/lib/ldap/[root@www openldap]# chown -R ldap:ldap /etc/openldap/slapd.ddb_open(/var/lib/ldap/id2entry.bdb) failed: No such file or directory (2)
[root@www openldap]# slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d/bdb_db_open: DB_CONFIG for suffix "dc=xionghuilin,dc=com" has changed.Performing database recovery to activate new settings.bdb_db_open: database "dc=xionghuilin,dc=com": recovery skipped in read-only mode. Run manual recovery if errors are encountered.bdb_db_open: database "dc=xionghuilin,dc=com": db_open(/var/lib/ldap/id2entry.bdb) failed: No such fileor directory (2).backend_startup_one (type=bdb, suffix="dc=xionghuilin,dc=com"): bi_db_open failed! (2)slap_startup failed (test would succeed using the -u switch)At least run slapd once, this issue will be resolved.
[root@www openldap]# /etc/init.d/slapd startStarting slapd: [ OK ]See the result:
[root@www openldap]# ls /etc/openldap/slapd.d/cn=config cn=config.ldif[root@www openldap]# ls /var/lib/ldap/alock __db.002 __db.004 __db.006 dn2id.bdb log.0000000001__db.001 __db.003 __db.005 DB_CONFIG id2entry.bdbPermission denied for “/etc/openldap/slapd.d/cn=config.ldif”
[root@www openldap]# /etc/init.d/slapd startChecking configuration files for slapd: [FAILED]ldif_read_file: Permission denied for "/etc/openldap/slapd.d/cn=config.ldif"slaptest: bad configuration file!Refer to this Link and this Link, change the ownership of the /etc/openldap/slapd.d
[root@www openldap]# chown -R ldap.ldap /etc/openopenct.conf openldap/[root@www openldap]# chown -R ldap.ldap /etc/openldap/slapd.d[root@www openldap]# /etc/init.d/slapd startStarting slapd: [ OK ]Successful result
[root@www openldap]# slaptest -f /etc/openldap/slapd.confconfig file testing succeeded[root@www openldap]# slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d/config file testing succeededReference
ldap安裝配置過程中遇到的錯誤,以及解決方法 [網絡配置] [已解決]===配置LDAP的問題=== RHEL6配置簡單LDAP服務器-基于TLS加密和NFS的用戶家目錄自動掛載 RHCE6 中 openLDAP服務器簡易配置