Hi list,

I am fighting with openldap for some time now and I can't get it to work. 

I started clean.
I've followed this tutorial, and everything works fine.

I used followed the example and only changed dc=company,dc=com into dc=mycompany,dc=org.

Then I want to import this file, because I am busy with a WebSphere book from Packtpub, and I need to follow along and setting up a LDAP server with these contents:

--------------------------

dn: o=mycompany.org
objectclass: top
objectclass: organization
o: mycompany.org

dn: ou=users,o=mycompany.org
objectclass:organizationalunit
ou: users
description: generic users branch

dn: ou=groups,o=mycompany.org
objectclass:organizationalunit
ou: groups
description: generic groups branch

dn: ou=roles,o=mycompany.org
objectclass:organizationalunit
ou: roles
description: generic roles branch

dn: cn=wasadmin,ou=roles,o=mycompany.org
cn: wasadmin
uid: wasadmin
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
userpassword: wasadmin
sn: wasadmin
givenname: wasadmin
title: wasadmin
description: WAS Administrator

dn: cn=ldapbind,ou=users,o=mycompany.org
cn: ldapbind
uid: ldapbind
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
userpassword: ldapbind
sn: ldapbind
givenname: ldapbind
title: ldapbind
description: ldapbind

dn: cn=Bob Jackson,ou=users,o=mycompany.org
cn: Bob Jackson
uid: bjackson
mail: bjackson@mycompany.org
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
userpassword: password
sn: Jackson
givenname: Bob
telephonenumber: 123456789
title: WAS Administrator
description: LDAP test user

dn: cn=Mary Smith,ou=users,o=mycompany.org
cn: Mary Smith
uid: msmith
mail: msmith@mycompany.org
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
userpassword: password
sn: Smith
givenname: Mary
telephonenumber: 123456789
title: WAS Administrator
description: LDAP test user

dn: cn=wasadmins,ou=groups,o=mycompany.org
objectclass: groupofnames
cn: wasadmins
description: WAS Admins
# add the group members all of which are 
# assumed to exist under people
member: cn=Bob Jackson,ou=users,o=mycompany.org
member: cn=Mary Smith,ou=users,o=mycompany.org
member: cn=wasadmin,ou=roles,o=mycompany.org


But when I want to import, I get this:

[root@CentOS-01 cn=config]# ldapadd -W -D cn=admin,dc=mycompany,dc=org -v -x -f /tmp/mycompanyorg.ldif 
ldap_initialize( <DEFAULT> )
Enter LDAP Password: 
add objectclass:
top
organization
add o:
mycompany.org
adding new entry "o=mycompany.org"
ldap_add: Server is unwilling to perform (53)
additional info: no global superior knowledge


When I do this:
[root@CentOS-01 cn=config]# ldapsearch -xLLWD cn=admin,dc=mycompany,dc=org -b dc=mycompany,dc=org dn
Enter LDAP Password: 
version: 1

No such object (32)

Something tells me it's wrong.

So, a friend who helped me said I had to create the company first, and that I should use dc=company,dc=org instead of o=company.org.

I had to create the company first in the LDAP he said, so he passed me this file:

# usergroups.ldif
#
#
dn: dc=mycompany,dc=org
dc: company
objectClass: top
objectClass: domain

dn: ou=users,dc=mycompany,dc=org
ou: Users
objectClass: top
objectClass: organizationalUnit
description: Central location for UNIX users

dn: ou=groups,dc=mycompany,dc=org
ou: Groups
objectClass: top
objectClass: organizationalUnit
description: Central location for UNIX groups

# EOF


But I can't add that:

[root@CentOS-01 cn=config]# ldapadd -W -D cn=admin,dc=mycompany,dc=org -v -x -f /tmp/usergroup.ldif 
ldap_initialize( <DEFAULT> )
Enter LDAP Password: 
add dc:
company
add objectClass:
top
domain
adding new entry "dc=mycompany,dc=org"
ldap_add: Naming violation (64)
additional info: value of single-valued naming attribute 'dc' conflicts with value present in entry



I hope I will ever solve this, I can't complete my study now and have wasted hours and hours on this ldap problem.

I hope you can help me out..

Karntol