|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
can't add to ldap, when run slapd returns an error
HI ,
i cant resolve some problems,i work with openldap-2.1.29 , mandrake 9.2, i really need your help. These are my slap.con ,ldif files an error messages that appears when runnig slapd,and when typng the search an add commands slapd.conf: include /usr/local/etc/openldap/schema/core.schema include /usr/local/etc/openldap/schema/cosine.schema pidfile /var/run/slapd.pid argsfile /var/run/slapd.args #################################################################### # ldbm database definitions ####################################################################### database bdb suffix "dc=example,dc=com" rootdn "cn=root,dc=example,dc=com" rootpw secret directory /usr/local/var/openldap-data # Indices to maintain index objectClass eq file ex.ldif: dn: dc=example,dc=com objectclass: dcObject objectclass: organization o: example dc: example.com dn: ou=app,dc=example,dc=com objectclass: organizationalUnit ou: app dn: cn=barbara jensen,ou=app,dc=example,dc=com objectclass: top objectclass: person objectclass: organizationalPerson cn: barbara jensen sn: jensen title: madame description: employee du departement app ldapsearch: [root@localhost rc.d]# ldapsearch -x -b "dc=example,dc=com" "(objectclass=*)" # extended LDIF # # LDAPv3 # base <dc=example,dc=com> with scope sub # filter: (objectclass=*) # requesting: ALL # # search result search: 2 result: 32 No such object # numResponses: 1 SERVER: [root@localhost root]# /usr/local/libexec/slapd -d 256 daemon: socket() failed errno=97 (Address family not supported by protocol) bdb_initialize: Sleepycat Software: Berkeley DB 4.1.25: (December 19, 2002) bdb_db_init: Initializing BDB database slapd starting AFTER TYPING LDAPSEARCH: conn=0 fd=12 ACCEPT from IP=127.0.0.1:1190 (IP=0.0.0.0:389) conn=0 op=0 BIND dn="" method=128 conn=0 op=0 RESULT tag=97 err=0 text= conn=0 op=1 SRCH base="dc=example,dc=com" scope=2 filter="(objectClass=*)" conn=0 op=1 RESULT tag=101 err=32 text= conn=0 op=2 UNBIND conn=0 fd=12 closed LDAPADD: [root@localhost rc.d]# ldapadd -x -D "cn=root,dc=example,dc=com" -W -f ex.ldif Enter LDAP Password: adding new entry "dc=example,dc=com" ldapadd: update failed: dc=example,dc=com ldap_add: Naming violation (64) additional info: value of naming attribute 'dc' is not present in entry SERVER AFTER TYPING LDAPADD: conn=1 fd=12 ACCEPT from IP=127.0.0.1:1191 (IP=0.0.0.0:389) conn=1 op=0 BIND dn="cn=root,dc=example,dc=com" method=128 conn=1 op=0 BIND dn="cn=root,dc=example,dc=com" mech=SIMPLE ssf=0 conn=1 op=0 RESULT tag=97 err=0 text= conn=1 op=1 ADD dn="dc=example,dc=com" conn=1 op=1 RESULT tag=105 err=64 text=value of naming attribute 'dc' is not present in entry conn=1 op=1 RESULT tag=105 err=64 text=value of naming attribute 'dc' is not present in entry conn=1 op=2 UNBIND conn=1 fd=12 closed i'm waiting for your help! |
|
#2
|
|||||
|
|||||
|
First please please post a valid subject otherwise we have no idea of what the post is about.
Quote:
try /usr/local/libexec/slapd -d 255 (255 instead of 256) Quote:
It appears your dn isn't correct change from -b "dc=example,dc=com" to -b "dc=example.com,dc=com" Quote:
again your auth dn wouldn't exist (unless it already does) -D "cn=root,dc=example,dc=com" try chaning to -D "cn=root,dc=com" (or whatever is the correct one) This may not be the case and it could be something different but I tried your ldiff file and it worked fine for me no naming violation
__________________
Miscellaneous Software Viper_SB Developershed E-Support Anyone else play chess? Challenge me |
|
#3
|
|||
|
|||
|
code php_ldap problem
Hi all,
i can't execute any php script,if anyone can help me i'll be greetful,these are he script and results i got: Script PHP: <? // Fichier de configuration pour l'interface PHP // de notre annuaire LDAP $server = "localhost"; $port = "389"; $racine = "dc=telecom, dc=tn"; $rootdn = "cn=root,dc=telecom, dc=tn"; $rootpw = "secret"; echo "Connexion...<br>"; $ds=ldap_connect($server); if ($ds==1) { // on s'authentifie en tant que super-utilisateur, ici, ldap_admin $r=ldap_bind($ds,$rootdn,$rootpw); // Ici les opérations à effectuer echo "Déconnexion...<br>"; ldap_close($ds); } else { echo "Impossible de se connecter au serveur LDAP"; } ?> [root@localhost root]# php /usr/local/connect.php -a Content-type: text/html X-Powered-By: PHP/4.3.5 Connexion...<br><br /> <b>Warning</b>: ldap_bind(): Unable to bind to server: Protocol error in <b>/usr/local/connect.php</b> on line <b>31</b><br /> Déconnexion...<br> server: [root@localhost root]# /usr/local/libexec/slapd -f /etc/openldap/slapd.conf -d 256 daemon: socket() failed errno=97 (Address family not supported by protocol) bdb_initialize: Sleepycat Software: Berkeley DB 4.1.25: (December 19, 2002) bdb_db_init: Initializing BDB database slapd starting conn=0 fd=12 ACCEPT from IP=127.0.0.1:1040 (IP=0.0.0.0:389) conn=0 op=0 BIND dn="cn=root,dc=telecom,dc=tn" method=128 conn=0 op=0 RESULT tag=97 err=2 text=requested protocol version not allowed conn=0 op=1 UNBIND conn=0 fd=12 closed is the problem with socket ,(error when starting ldap) and how can i deal with i'm waiting for yor help(php4.3.5) |
|
#4
|
||||
|
||||
|
try this /usr/local/libexec/slapd -d 255 I said this in my previous post try it first then let me know if it doesn't work
as far as php if you can connect to your ldap with another program (like ldapsearch or ldapadmin) then php can connect otherwise it's an ldap problem |
|
#5
|
|||
|
|||
|
i changed my ldif file and (ldapsearch,ldapadd..)work.only the php scripts does'nt work is it a dns problem? have to configure the dns or what? thx
|
|
#6
|
||||
|
||||
|
try this out and post what it says
Code:
<?php
$host = 'localhost';
$port = 389;
$link = ldap_connect($host, $port);
ldap_bind($link);
if (ldap_error($link) == "Can't contact LDAP server") {
print "Could not connect to LDAP server '".$host."' on port '".$port."'");
}
if (ldap_bind($link, $userdn, $password) === false) {
print "ldap error: ".ldap_error($link)."<br>";
}
?>
|
|
#7
|
|||
|
|||
|
programme php
I Try this code:
<br /> <b>Warning</b>: ldap_bind(): Unable to bind to server: Can't contact LDAP server in <b>/root/dev.php</b> on line <b>7</b><br /> Could not connect to LDAP server 'localhoast' on port '389'<br /> <b>Warning</b>: ldap_bind(): Unable to bind to server: Can't contact LDAP server in <b>/root/dev.php</b> on line <b>11</b><br /> ldap error: Can't contact LDAP server<br> |
![]() |
| Viewing: Dev Shed Forums > Databases > LDAP Programming > can't add to ldap, when run slapd returns an error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|