Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Howto: Creating a central outlook addressbook with OpenLDAP.
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Mon Jan 19, 2004 9:09 pm    Post subject: Howto: Creating a central outlook addressbook with OpenLDAP. Reply with quote

Building an outlook addressbook with OpenLDAP.

This howto discribes how you can build a central outlook adressbook with OpenLDAP.
When you have your addressbook running, you only have to maintain this addressbook. There is no longer need to change the addressbook of every outlook client if an address changes.
In my excamples we pretend that we use the domain gentoo.org.

First of all you need to install OpenLDAP on your Gentoo server.
Code:

#emerge openldap


Once this is done, you need to edit /etc/openldap/slapd.conf.
Code:

#nano -w /etc/slapd.conf


Make sure it looks like this:
Code:

include         /etc/openldap/schema/core.schema
include         /etc/openldap/schema/cosine.schema
include         /etc/openldap/schema/inetorgperson.schema
include         /etc/openldap/schema/extension.schema
                                                                                                                                                                                                                                                                                           
pidfile         /var/run/openldap/slapd.pid
argsfile        /var/run/openldap/slapd.args

database        ldbm
suffix          "dc=gentoo,dc=org"
rootdn          "dc=gentoo,dc=org"
rootpw          secret
directory       /var/lib/openldap-ldbm
index   objectClass     eq


It is possible to use an encrypted password but I don't know how . If you want it encrypted, there are many howto's who will tell you how to do it.

We included 'extension.schema' in slapd.conf but his file doesn't excist.
So we have to create it.
Code:

#nano -w /etc/openldap/schema/extension.schema


Paste the following into extension.schema and save it.

Code:

attributetype ( 1.3.6.1.4.1.4203.666.100.121
        NAME ( 'rdn' )
        SUP name )

attributetype ( 1.3.6.1.4.1.4203.666.100.122
        NAME ( 'otherFacsimiletelephoneNumber' )
        SUP telephoneNumber )

attributetype ( 1.3.6.1.4.1.4203.666.100.123
        NAME ( 'IPPhone' )
        SUP telephoneNumber )

# This attribute handles MS/Outlook and Netscape Communicator

attributetype ( 1.3.6.1.4.1.4203.666.100.124
        NAME ( 'URL' 'homeUrl' )
        SUP name )

attributetype ( 1.3.6.1.4.1.4203.666.100.125
        NAME ( 'comment' )
        SUP name )

attributetype ( 1.3.6.1.4.1.4203.666.100.126
        NAME ( 'conferenceInformation' )
        SUP name )

attributetype ( 1.3.6.1.4.1.4203.666.100.127
        NAME ( 'reports' )
        SUP manager )

objectclass     ( 1.3.6.1.4.1.4203.666.100.1
    NAME 'officePerson'
        DESC 'Office employee or computer user'
    SUP inetOrgPerson
    STRUCTURAL
        MAY  ( c $
               rdn $
               otherFacsimiletelephoneNumber $
               IPPhone $
               URL $
               comment $
               reports $
               conferenceInformation )
    )


Now we need to edit cosine.schema
Code:

#nano -w /etc/openldap/schema/cosine.schema


Edit the following in cosine.schema

Code:

Change: NAME ( 'mobile' 'mobileTelephoneNumber' )
         to: NAME ( 'mobile' 'mobileTelephoneNumber' 'cellPhone' )
Also change: NAME ( 'pager' 'pagerTelephoneNumber' )
         to: NAME ( 'pager' 'pagerTelephoneNumber' 'pagerPhone' )


Now we can start the slapd.
Code:

/etc/init.d/slapd start


We have to create a new directory. To do that you need to create a new 'ldif file'
Code:

#nano -w directory.ldif


Paste the following in directory.ldif and save it.
Code:

dn:     dc=gentoo, dc=org
objectClass:    top
objectClass:    dcObject
objectClass:    organization
dc:     gentoo
o:      Name-of-your-organization.


Now you can insert the new directory with 'ldapadd'
Remember that the password is 'secret' (it is set in slapd.conf)
Code:

#ldapadd -D "dc=gentoo, dc=org" -f directory.ldif -W


Now we need to create a container where we can put our contacts. Create a new ldif-file.
Code:

#nano -w container.ldif


And paste the following in container.ldif
Code:

dn:     ou=addressbook, dc=gentoo, dc=org
objectClass:    top
objectClass:    organizationalUnit
ou:     addressbook


The name of the container will be 'addressbook'. But you are free to choose any name you like.
Now you can add the new container with 'ldapadd'
Code:

#ldapadd -D "dc=gentoo, dc=org" -f container.ldif -W


Now we have a container we can add our contacts. To do that create another ldif-file.
Code:

#nano -w contact.ldif


Paste the following into contact.ldif. You need to edit the contacts information like name, email address, etc.
Code:

dn: cn=Name of the Record,ou=addressbook,dc=gentoo,dc=org
ou: addressbook
o: Name-of-your-campany
cn: Contacts full name
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: officePerson
mail: contact@gentoo.org
givenname: Contacts first name
sn: Contacts surname
homePostalAddress: Needs no explanation ;)
postalAddress: work postal address
l: City name
st: State
postalcode: needs no axplanation either
c: Country
pager: what's a pager anyway??? Just fill in: 'not available'
telephoneNumber: work phone number
homePhone: home phome number
mobile: mobile phone number
title: just some title
URL: http://www.gentoo.org


Now you can add your new contact to the LDAP database with:
Code:

#ldapadd -f contact.ldif -D "dc=gentoo, dc=org" -W


After that you can edit contact.ldif to add a new contact to your LDAP database.

Now you need to setup outlook you use your database. (Keep in mind that I don't use the english version. So my howto might give the wrong names for tabs and buttons). To do that open outlook, click on 'extra' and than 'services' (dutch version) click on 'add' and choose 'microsoft LDAP addressbook' (or something like that, you'll know wich one ;)
For server, fill in your Gentoo-server ip-address. For search (the fields defauld value is: c=us) fill in: ou=addressbook, dc=gentoo, dc=org (mind the komma's , )
After that you need to alter the search routine so outlook will check the LDAP database first.
Click on the 'address' tab and add your LDAP addressbook to the standard outlook addressbooks. Make sure LDAP is on top of the other addressbooks. If so, outlook will search the LDAP addressbook first.
Now you are ready to use your addressbook. Create a new email with outlook. in the 'to' field, fill in you contacts name and click on 'check names'. Outlook will search your LDAP database for contacts and, if you did well, come up with the correct email address.

To manage your addressbook I recommend 'phpldapadmin' This is a phpscript that you need to run with apache on your Gentoo-server. So you need to emerge apache first. Make sure that you have 'ldap' in you /etc/make.conf.
Code:

#emerge apache

Make sure that apache has the php-modules (this should be ok. If not, there are plenty apache howto's) and start apache.
Code:

#/etc/init.d/apache2 start


Now you can emerge phpldapadmin. When I installed it, it was still masked so you have to use the full path.
Code:

#emerge /usr/portage/net-nds/phpldapadmin/phpldapadmin-0.9.3.ebuild


phpldapadmin will be put in /var/www/localhost/htdocs/phpldapadmin/ there you will find a config file 'config.php.example'. You need to edit this file and save it as 'config.php'
Code:

#nano -w /var/www/localhost/htdocs/phpldapadmin/config.php.example


By now you should now what should be edited. You only have to edit a few first lines so phpldapadmin knows what the name, passwd, etc of your LDAP database is. Don't forget to save it as config.php!!
Now you can access and maintain your LDAP database with your browser. Open your browser and give the ip of your Gentoo-server. For example:
Code:

192.168.0.1/phpldapadmin


Your will enter a beautifull interface and maintaining yor database is a piece of cace from now an ;)
Your database can also be used with Evolution. Before you can, you might need to re-emerge Evolution with ldap support (have 'ldap' in your /etc/make.conf and re-emerge Evolution)

If everything went well, you have yor database running by now. With this howto it should been pretty simple. It took me more that 2 days to figure it all out from many howto's. So I hope I helped many people be writing this howto. 8)


***********************************************************
UPDATE: Making a backup of your adressbook.
***********************************************************

You can make a backup with slapcat. It simply "greps" all the information
out of your adressbook and puts in it a file in LDIF-format.
Code:

slapcat -f /etc/openldap.slapd.conf -l backup_adressbook.ldif

May something happen to your server you can import this file into your
new ldapserver with ldapadd.
Code:

ldapadd -D "dc=gentoo, dc=org" -f backup_adressbook.ldif -W

Unfortunately you have to edit the file fist before you can import it.
The file contains the information to create new groups (dc=gentoo,
dc=org and the subgroup ou=adressbook) This might be handy when
you must setup a new database from scratch, in that case you can just
import it and your done :)
The file also contains some extra information that will frustrate everything.
I had to strip it all out before I could use the file. You must delete the
following entries from every contact:
Code:

creatorsName:
createTimestamp:
modifiersName:
modifyTimestamp:

It might take some time. But on the other hand, it goes much faster than
creating an entirely new database from scratch ;)



************************************************************
UPDATE: Update OpenLDAP to version .2.1.26
************************************************************

Here is how I updated OpenLDAP to version 2.1.26.
After I first updated to version 2.1.26, I deleted the new schema files.
When I restarted OpenLDAP, nothing worked anymore. So I downgraded
the the last working version.
The second try, I overwrited the schema files with the new ones and made the
same changes in cosine.schema as discribed in this howto.
After this, OpenLDAP started without any error. However, my entire database
was gone, I have no idea how that could have happend?? :?
But fortunately I had a backup, as discripbed in the previous update. So I can
tell that restoring your database with that backupmethod isn't too much trouble :)



************************************************************
UPDATE: Evolution 2.0
************************************************************
I found a really nice option in Evolution 2.0
Evolution 2.0 can acces the central addressbook as good as outlook does. Maybe even better!
After you added the LDAP addresbook in Evolution, go to tools --> settings --> autocompletion
Disable the autocompletion for the standard, local, addressbook and enable the autocompletion for your LDAP addresbook.
Now the good part. Click on 'new mail' to write a mail to someone. Just type the name
of the person and Evolution wil automaticly search the LDAP-database and come up with
the right name and email-address. If more matches are found, you can select the right one.
Works quite cool :D


************************************************************
UPDATE: Problems with outlook 2003
************************************************************
I had problems with several outlook 2003 installations, that coudn't connect
my central addressbook. Fortunately, the solution turned out to be fairly easy.
The solution can be found in Microsoft's KB 555536.

To make things easier, I made a .reg file that does this automaticly. It can be downloaded here.

Unfortunately, this method only works for the active account. So, if you have more than
1 person working on a computer, you have to run this on every account. If someone could
tell me how to do this on a system wide scale, so it affects all the accounts? :?


************************************************************
UPDATE: OpenLDAP-2.4
************************************************************
It seems that ldbm support is dropped in OpenLDAP-2.4. To overcome this problem, I made a backup of my contact, using slapcat
(see Making a backup of your adressbook. earlier in the article) I strongly suggest you do this before updating anything :wink:
Update to OpenLDAP-2.4 and make sure the berkdb USE-flag is turned on.
Edit /etc/openldap/slapd.conf and change these lines:
Code:

database        ldbm
directory       /var/lib/openldap-ldbm

to:
Code:

database        bdb
directory       /var/lib/openldap-bdb

Create the DB-directory:
Code:

mkdir /var/lib/openldap-bdb
chown ldap:ldap /var/lib/openldap-bdb

Start openldap and restore your contacts from the backup you made.


sources:
www.openldap.org
http://devel.linvision.com/doc/lih/current/index.html
http://www.linux.org.tw/CLDP/OLD/HOWTO/LDAP-HOWTO-5.html
http://www.onlamp.com/pub/a/onlamp/2003/03/27/ldap_ab.html
http://yolinux.com/TUTORIALS/LinuxTutorialLDAP-GILSchemaExtension.html


Mario.
_________________
If there is one thing to learn from history, it's that we usualy don't learn anything from it, at all.


Last edited by mariourk on Fri Oct 08, 2010 4:07 pm; edited 14 times in total
Back to top
View user's profile Send private message
tecknojunky
Veteran
Veteran


Joined: 19 Oct 2002
Posts: 1937
Location: Montréal

PostPosted: Sun Jan 25, 2004 11:56 am    Post subject: Reply with quote

two typos:

The first nano file you specify to edit: /etc/openldap.slapd.conf

When mentionning evolution, you say we might have to re-emerge Outlook. Boy, I wish I could :D
_________________
(7 of 9) Installing star-trek/species-8.4.7.2::talax.
Back to top
View user's profile Send private message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Sun Jan 25, 2004 12:45 pm    Post subject: Reply with quote

Oops... :roll:
Corrected it, thanks for the tip. :wink:
Back to top
View user's profile Send private message
tecknojunky
Veteran
Veteran


Joined: 19 Oct 2002
Posts: 1937
Location: Montréal

PostPosted: Sun Jan 25, 2004 1:02 pm    Post subject: Reply with quote

...and...

Quote:
# /etc/init.d/slapd restart
* Stopping ldap-server... [ ok ]
* Starting ldap-server...
/etc/openldap/schema/extension.schema: line 37: AttributeType not found: [ !! ]


I'll try to find the attribute by figuring what is actualy called in slapd and run it from the prompt so it will display it (i hope).

RESULT:
Quote:
# /usr/lib/openldap/slapd
/etc/openldap/schema/extension.schema: line 37: AttributeType not found: "rdn"


... and if I remove it, the next attribute cause slapd to complain, and so on.
_________________
(7 of 9) Installing star-trek/species-8.4.7.2::talax.
Back to top
View user's profile Send private message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Sun Jan 25, 2004 1:16 pm    Post subject: Reply with quote

Hmm, I hope you can figure it out.
I have no idea why this doesn't work for you.
I did/does for me. :?
It might help if you comment out line 37???

This is how I emerged OpenLDAP:
Code:

mail root # emerge openldap -vp
 
These are the packages that I would merge, in order:
 
Calculating dependencies ...done!
[ebuild   R   ] net-nds/openldap-2.0.27-r4  +ssl +tcpd +readline -ipv6 +berkdb +gdbm -kerberos -odbc
Back to top
View user's profile Send private message
tecknojunky
Veteran
Veteran


Joined: 19 Oct 2002
Posts: 1937
Location: Montréal

PostPosted: Mon Jan 26, 2004 6:54 am    Post subject: Reply with quote

I have openldap emerge for a long time for centralized user/password. I just wanted to try using ldap address book feature in evolution and I stumbled on your thread.

This message appear because of the extension.schema. OpenLDAP can't recognise none of what is specified in "objectclass".

There is obviously a step missing, altough I did everything stated in your howto.

For the moment, I commented the include extension.schema directive in slapd.conf so that my users can at least authenticate themselves.
_________________
(7 of 9) Installing star-trek/species-8.4.7.2::talax.
Back to top
View user's profile Send private message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Mon Jan 26, 2004 8:34 am    Post subject: Reply with quote

I added a new link to 'sources'.
Maybe this howto can help you? :?
Back to top
View user's profile Send private message
tecknojunky
Veteran
Veteran


Joined: 19 Oct 2002
Posts: 1937
Location: Montréal

PostPosted: Mon Jan 26, 2004 11:41 am    Post subject: Reply with quote

Well, not really.

Doing my own research, I've found out that evolution bundle it's own schema, located at /usr/share/evolution/1.4/evolutionperson.schema on the machine where you emerged it. So I copied that file to /etc/openldap/schema, chown root:root it and chmod it to 444. So instead of including your extension.schema, I include evolutionperson.schema instead. I will deal with Outlook users later.

In evolution, I can authenticate to the ldap server, but everything seem to be read only. So that's where I am.

There is a very nice slide pdf about OpenLDAP at ftp://kalamazoolinux.org/pub/pdf/ldapv3.pdf (warning: this has biblical proportions, so it's huge!). The evolution section is at page 371.

It makes you wonder, what is it that OpenLDAP can't do?

Ps. You changed one typo for another. /etc/openldap.slapd.conf is now /etc/slapd.conf :P :roll:
_________________
(7 of 9) Installing star-trek/species-8.4.7.2::talax.
Back to top
View user's profile Send private message
Arno
Tux's lil' helper
Tux's lil' helper


Joined: 19 Oct 2002
Posts: 126
Location: France

PostPosted: Mon Jan 26, 2004 9:40 pm    Post subject: Re: Creating a central outlook addressbook with OpenLDAP how Reply with quote

mariourk wrote:

It is possible to use an encrypted password but I don't know how . If you want it encrypted, there are many howto's who will tell you how to do it.

That's easy. Use slappasswd.
Code:

# /usr/sbin/slappasswd
New password:
Re-enter new password:
{SSHA}1234567890abcdef

The copy the encrypted password (with the {SSHA}) in your slapd.conf:
Code:

rootpw          {SSHA}1234567890abcdef
Back to top
View user's profile Send private message
golem
n00b
n00b


Joined: 23 Jan 2003
Posts: 3

PostPosted: Tue Jan 27, 2004 11:15 am    Post subject: Reply with quote

thx to mariourk for the how-to... got my ldap up and running, to find out that moz thunderbird doesnt really support it all that well as of yet :/

installed phpLDAPadmin on my system and hacked up the new_address_template.php to work with the settings described in the howto (a quick and dirty hack, but should work for yall)

Code:

<?php

require 'common.php';

// customize this to your needs
$default_container = "ou=Addresses";

// Common to all templates
$container = $_POST['container'];
$server_id = $_POST['server_id'];

// Unique to this template
$step = isset( $_POST['step'] ) ? $_POST['step'] : 1;

check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );

?>

<script language="javascript">
<!--

/*
 * Populates the common name field based on the last
 * name concatenated with the first name, separated
 * by a blank
 */
function autoFillCommonName( form )
{
   var first_name;
   var last_name;
   var common_name;

        first_name = form.first_name.value;
        last_name = form.last_name.value;

   if( last_name == '' ) {
      return false;
   }

   common_name = first_name + ' ' + last_name;
   form.common_name.value = common_name;
}

-->
</script>

<center><h2>New Address Book Entry<br />
<small>(InetOrgPerson-modified)</small></h2>
</center>

<?php if( $step == 1 ) { ?>

<form action="creation_template.php" method="post" id="address_form" name="address_form">
<input type="hidden" name="step" value="2" />
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />

<center>
<table class="confirm">
<tr class="spacer"><td colspan="3"></tr>
<tr>
   <td><img src="images/uid.png" /></td>
   <td class="heading">Name:</td>
   <td>
      <input type="text" name="first_name"
         id="first_name" value="first" onChange="autoFillCommonName(this.form)" />
      <input type="text" name="last_name"
         id="last_name" value="last" onChange="autoFillCommonName(this.form)" />
   </td>
</tr>
<tr>
   <td></td>
   <td class="heading">Common name:</td>
   <td><input type="text" name="common_name" id="common_name" value="" /></td>
</tr>
<tr>
   <td></td>
   <td class="heading">Organization:</td>
   <td><input type="text" name="organization" id="organization" value="" /></td>
</tr>
<tr>
   <td></td>
   <td class="heading">Title:</td>
   <td><input type="text" name="title" id="title" value="" /></td>
</tr>
<tr class="spacer"><td colspan="3"></tr>
<tr>
   <td><img src="images/mail.png" /></td>
   <td class="heading">Address:</td>
   <td><input type="text" name="street" id="street" value="" /></td>
</tr>
<tr>
   <td></td>
   <td class="heading">City:</td>
   <td><input type="text" name="city" id="city" value="" /></td>
</tr>
<tr>
   <td></td>
   <td class="heading">State:</td>
   <td><input type="text" name="state" id="state" value="" /></td>
</tr>
<tr>
   <td></td>
   <td class="heading">Postal code:</td>
   <td><input type="text" name="postal_code" id="postal_code" value="" /></td>
</tr>
<tr>
   <td></td>
   <td class="heading">Country:</td>
   <td><input type="text" name="country" id="country" value="" /></td>
</tr>
<tr>
   <td><img src="images/mail.png" /></td>
   <td class="heading">Work Address:</td>
   <td><input type="text" name="workstreet" id="workstreet" value="" /></td>
</tr>
<tr class="spacer"><td colspan="3"></tr>
<tr>
   <td><img src="images/phone.png" /></td>
   <td class="heading">Work phone:</td>
   <td><input type="text" name="telephone_number" id="telephone_number" value="" /></td>
</tr>
<tr>
   <td></td>
   <td class="heading">Home phone:</td>
   <td><input type="text" name="homephone_number" id="homephone_number" value="" /></td>
</tr>
<tr>
   <td></td>
   <td class="heading">Mobile:</td>
   <td><input type="text" name="mobile_number" id="mobile_number" value="" /></td>
</tr>
<tr>
   <td></td>
   <td class="heading">Email:</td>
   <td><input type="text" name="email_address" id="email_address" value="" /></td>
</tr>
<tr>
   <td></td>
   <td class="heading">URL:</td>
   <td><input type="text" name="url" id="url" value="" /></td>
</tr>
<tr class="spacer"><td colspan="3"></tr>
<tr>
   <td></td>
   <td class="heading">Container:</td>
   <td><input type="text" name="container" size="40"
      value="<?php if( isset( $container ) )
            echo htmlspecialchars( $container );
              else
            echo htmlspecialchars( $default_container . ',' . $servers[$server_id]['base'] ); ?>" />
      <?php draw_chooser_link( 'address_form.container' ); ?></td>
   </td>
</tr>
<tr>
   <td colspan="3"><center><br /><input type="submit" value="Proceed &gt;&gt;" /></td>
</tr>
</table>
</center>

<?php } elseif( $step == 2 ) {

   $common_name = trim( $_POST['common_name'] );
   $first_name = trim( $_POST['first_name'] );
   $last_name = trim( $_POST['last_name'] );
   $organization = trim( $_POST['organization'] );
   $city = trim( $_POST['city'] );
     $state = trim( $_POST['state'] );
     $title = trim( $_POST['title'] );
     $country = trim( $_POST['country'] );
     $url = trim( $_POST['url'] );
   $postal_code = trim( $_POST['postal_code'] );
   $street = trim( $_POST['street'] );
     $workstreet = trim( $_POST['workstreet'] );
   $telephone_number = trim( $_POST['telephone_number'] );
   $homephone_number = trim( $_POST['homephone_number'] );
   $mobile_number = trim( $_POST['mobile_number'] );
   $email_address = trim( $_POST['email_address'] );
   $container = trim( $_POST['container'] );

   /* Critical assertions */
   0 != strlen( $common_name ) or
      pla_error( "You cannot leave the Common Name blank. Please go back and try again." );

   ?>
   <center><h3>Confirm entry creation:</h3></center>

   <form action="create.php" method="post">
   <input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
   <input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'cn=' . $common_name . ',' . $container ); ?>" />

   <!-- ObjectClasses  -->
   <?php $object_classes = rawurlencode( serialize( array( 'top', 'person', 'organizationalPerson', 'inetOrgPerson', 'officePerson' ) ) ); ?>

   <input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />

   <!-- The array of attributes/values -->
   <input type="hidden" name="attrs[]" value="cn" />
      <input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($common_name);?>" />
   <input type="hidden" name="attrs[]" value="givenName" />
      <input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($first_name);?>" />
   <input type="hidden" name="attrs[]" value="sn" />
      <input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($last_name);?>" />
   <input type="hidden" name="attrs[]" value="o" />
      <input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($organization);?>" />
   <input type="hidden" name="attrs[]" value="l" />
      <input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($city);?>" />
         <input type="hidden" name="attrs[]" value="st" />
            <input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($state);?>" />
         <input type="hidden" name="attrs[]" value="c" />
            <input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($country);?>" />
         <input type="hidden" name="attrs[]" value="postalAddress" />
            <input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($workstreet);?>" />
         <input type="hidden" name="attrs[]" value="title" />
            <input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($title);?>" />
   <input type="hidden" name="attrs[]" value="postalCode" />
      <input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($postal_code);?>" />
   <input type="hidden" name="attrs[]" value="homePostalAddress" />
      <input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($street);?>" />
   <input type="hidden" name="attrs[]" value="telephoneNumber" />
      <input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($telephone_number);?>" />
   <input type="hidden" name="attrs[]" value="homePhone" />
      <input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($homephone_number);?>" />
   <input type="hidden" name="attrs[]" value="mobile" />
      <input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($mobile_number);?>" />
   <input type="hidden" name="attrs[]" value="mail" />
      <input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($email_address);?>" />
   <input type="hidden" name="attrs[]" value="URL" />
      <input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($url);?>" />
   <center>
   <table class="confirm">
   <tr class="even">
      <td class="heading">Common name:</td>
      <td><b><?php echo htmlspecialchars( $common_name ); ?></b></td>
   </tr>
   <tr class="odd">
      <td class="heading">First name:</td>
      <td><b><?php echo htmlspecialchars( $first_name ); ?></b></td>
   </tr>
   <tr class="even">
      <td class="heading">Last name:</td>
      <td><b><?php echo htmlspecialchars( $last_name ); ?></b></td>
   </tr>
   <tr class="odd">
      <td class="heading">Organization:</td>
      <td><?php echo htmlspecialchars( $organization ); ?></td>
   </tr>
   <tr class="even">
      <td class="heading">City:</td>
      <td><?php echo htmlspecialchars( $city ); ?></td>
   </tr>
   <tr class="odd">
      <td class="heading">Postal code:</td>
      <td><?php echo htmlspecialchars( $postal_code ); ?></td>
   </tr>
   <tr class="even">
      <td class="heading">Street:</td>
      <td><?php echo htmlspecialchars( $street ); ?></td>
   </tr>
   <tr class="odd">
      <td class="heading">Work phone:</td>
      <td><?php echo htmlspecialchars( $telephone_number ); ?></td>
   </tr>
   <tr class="even">
      <td class="heading">Home phone:</td>
      <td><?php echo htmlspecialchars( $homephone_number ); ?></td>
   </tr>
   <tr class="odd">
      <td class="heading">Mobile:</td>
      <td><?php echo htmlspecialchars( $mobile_number ); ?></td>
   </tr>
   <tr class="even">
      <td class="heading">Email:</td>
      <td><?php echo htmlspecialchars( $email_address ); ?></td>
   </tr>
   <tr class="odd">
      <td class="heading">Container:</td>
      <td><?php echo htmlspecialchars( $container ); ?></td>
   </tr>
   </table>
   <br /><input type="submit" value="Create Address" />
   </center>
   </form>

<?php } ?>

</body>
</html>
Back to top
View user's profile Send private message
reinier
n00b
n00b


Joined: 30 Jan 2004
Posts: 12
Location: Netherlands

PostPosted: Mon Feb 02, 2004 5:01 pm    Post subject: Reply with quote

Please also read my posts at https://forums.gentoo.org/viewtopic.php?p=825542#825542 (and the one above that). My first problem is getting ldapadd to work for me...

ldapadd -D '...' -f directory.ldif -w secret -v
ldap_initialize( <DEFAULT> )
ldap_bind: Invalid credentials

My second problem is basically that phpldapadmin doesn't seem to work... does anyone have any suggestions? :)
Back to top
View user's profile Send private message
karwoski
n00b
n00b


Joined: 30 Jun 2002
Posts: 16
Location: Columbia, MO

PostPosted: Mon Feb 02, 2004 6:37 pm    Post subject: Reply with quote

Another very minor typo:

Quote:
Now you can add the new cantainer with 'ldapadd'


Thanks for the guide. Can't wait to try it out.
Back to top
View user's profile Send private message
DumbAss
Apprentice
Apprentice


Joined: 30 Sep 2003
Posts: 247
Location: 't Steen

PostPosted: Wed Feb 04, 2004 11:34 am    Post subject: Reply with quote

Can Outlook and evolution use the same directory now? Or do you have to use two different ones? That would suck.

And can you write with outlook to the directory or do you need to use a third-party tool?
Back to top
View user's profile Send private message
braindead0
Tux's lil' helper
Tux's lil' helper


Joined: 29 Apr 2003
Posts: 146
Location: Ohio

PostPosted: Wed Feb 04, 2004 11:59 pm    Post subject: Reply with quote

Is there any way to allow gpilot to sync up with ldap and update ldap? I'd love to have ldap running at home and sync my palm with it..take it to work, sync with outlook...etc..
Back to top
View user's profile Send private message
vdboor
Guru
Guru


Joined: 03 Dec 2003
Posts: 592
Location: The Netherlands

PostPosted: Thu Feb 05, 2004 12:07 am    Post subject: Reply with quote

great howto. :) but I'm curious, what does this mean:?

Code:
root# ldapadd -D "dc=linux,dc=lan" -f my-own.ldif -w secret
ldap_bind: Invalid credentials

_________________
The best way to accelerate a windows server is by 9.81M/S²
Linux user #311670 and Yet Another Perl Programmer

[ screenies | Coding on KMess ]
Back to top
View user's profile Send private message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Thu Feb 05, 2004 5:56 pm    Post subject: Reply with quote

DumbAss wrote:
Can Outlook and evolution use the same directory now? Or do you have to use two different ones? That would suck.

And can you write with outlook to the directory or do you need to use a third-party tool?


Evolution can use the same directory. However, you have to search the contacts manualy. In outlook you can just type the name in the "to" field.
Outlook will automaticly search the ldap-directory for contacts that match this name. Evolution doesn't have this function :(
Back to top
View user's profile Send private message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Thu Feb 05, 2004 6:14 pm    Post subject: Reply with quote

vdboor wrote:
great howto. :) but I'm curious, what does this mean:?

Code:
root# ldapadd -D "dc=linux,dc=lan" -f my-own.ldif -w secret
ldap_bind: Invalid credentials


The the directory in your "ldapadd command" ("dc=linux,dc=lan") is wrong.
What does the suffix-line in your /etc/openldap/slapd.conf say? Use those values.
Back to top
View user's profile Send private message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Thu Feb 05, 2004 6:21 pm    Post subject: Reply with quote

braindead0 wrote:
Is there any way to allow gpilot to sync up with ldap and update ldap? I'd love to have ldap running at home and sync my palm with it..take it to work, sync with outlook...etc..


What do you mean, sync your palmtop with the ldap-database? I suppose that depends on the sync-software of your palm...
If you wish to update the ldap-database with the values of your palm, Iam afraid that's not gonna work. As far as I know it is not possible to edit a ldap-directory with any email program (like outlook, Evolution, etc)
Back to top
View user's profile Send private message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Thu Feb 05, 2004 6:34 pm    Post subject: Reply with quote

In case you didn't figure it out yet, phpldapadmin can perfectly be used to add new contacts. Just click on "create new" (make sure you choose the right one, the upper one :wink: ) and choose " Address Book Entry (inetOrgPerson)". Fill in the right values (name, email, etc) click on proceed and confirm. The contacts added this way will be a little different that those who where added like dircribed in my howto. But thay work perfectly :D
Back to top
View user's profile Send private message
reinier
n00b
n00b


Joined: 30 Jan 2004
Posts: 12
Location: Netherlands

PostPosted: Fri Feb 06, 2004 11:46 am    Post subject: Reply with quote

mariourk wrote:
In case you didn't figure it out yet, phpldapadmin can perfectly be used to add new contacts. Just click on "create new" (make sure you choose the right one, the upper one :wink: ) and choose " Address Book Entry (inetOrgPerson)". Fill in the right values (name, email, etc) click on proceed and confirm. The contacts added this way will be a little different that those who where added like dircribed in my howto. But thay work perfectly :D


Hey mariourk, I have finally succesfully set up openldap/2.0.27 and phpmyadmin/2.5.4 ... slapd is running and I added a test entry which I can also access with MS Outlook. I also figured out how to access phpmyadmin and can log in...
My problem is now that I don't know how to access the entries I made with ldapadd (appear to be dbb files in /var/lib/openldap-ldbm/) in phpmyadmin (looking for mysql databases like MYD MYI frm in /var/lib/mysql/)...
I tried symlinking my ../openldap-ldbm/ directory to /var/lib/mysql/ but phpmyadmin returned an error message (13 if I remember correctly). How can I access and change my LDAP entries in phpmyadmin? Specific instructions would be helpful :)
Back to top
View user's profile Send private message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Fri Feb 06, 2004 2:33 pm    Post subject: Reply with quote

reinier wrote:
mariourk wrote:
In case you didn't figure it out yet, phpldapadmin can perfectly be used to add new contacts. Just click on "create new" (make sure you choose the right one, the upper one :wink: ) and choose " Address Book Entry (inetOrgPerson)". Fill in the right values (name, email, etc) click on proceed and confirm. The contacts added this way will be a little different that those who where added like dircribed in my howto. But thay work perfectly :D


Hey mariourk, I have finally succesfully set up openldap/2.0.27 and phpmyadmin/2.5.4 ... slapd is running and I added a test entry which I can also access with MS Outlook. I also figured out how to access phpmyadmin and can log in...
My problem is now that I don't know how to access the entries I made with ldapadd (appear to be dbb files in /var/lib/openldap-ldbm/) in phpmyadmin (looking for mysql databases like MYD MYI frm in /var/lib/mysql/)...
I tried symlinking my ../openldap-ldbm/ directory to /var/lib/mysql/ but phpmyadmin returned an error message (13 if I remember correctly). How can I access and change my LDAP entries in phpmyadmin? Specific instructions would be helpful :)


I have no experience with "phpmyadmin". I use "phpldapadmin".
Another program I used (and worked good) is "ldapbrowser". Maybe you can give that a try.
Back to top
View user's profile Send private message
reinier
n00b
n00b


Joined: 30 Jan 2004
Posts: 12
Location: Netherlands

PostPosted: Fri Feb 06, 2004 11:39 pm    Post subject: Reply with quote

Ah sorry 8O, I was thinking something else when I wrote my last post... But I actually do have a problem with my phpldapadmin/0.9.3 install. When I try to access the http://host/phpldapadmin/ I receive the error message:

"Your install of PHP appears to be missing LDAP support. Please install LDAP support before using phpLDAPadmin."

I tried re-emerging php and mod_php with the USE="ldap" command (it is also included in my /etc/make.conf file, but to no avail... other apps like squirrelmail (which also uses php but not ldap) do work. Strangely enough, my test.php file (with <? phpinfo(); ?>) shows:

Configure Command (table one, third row)
'./configure' ........ '--without-ldap' ....... '--with-config-file-path=/etc/php/apache1-php4'

Does that give some clue as to why my PHP is installed without LDAP support? Do I have to re-emerge apache or something else, that doesn't really make sense to me... (btw, I restarted apache and slapd whenever I thought necessary). Any help would be appreciated ;)
Back to top
View user's profile Send private message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Sat Feb 07, 2004 9:32 am    Post subject: Reply with quote

It seems that Apache needs to be emerged with ldap support.
Perhaps the time you emerged Apache you hadn't ldap in you USE-flags, so Apache is emerged without ldap support.
Code:

Chimaera root # emerge apache -vp
 
These are the packages that I would merge, in order:
 
Calculating dependencies ...done!
[ebuild   R   ] net-www/apache-2.0.48-r1  +berkdb +gdbm +ldap

I think that re-emerging apache, this time with ldap support, will solve your problem.
Back to top
View user's profile Send private message
reinier
n00b
n00b


Joined: 30 Jan 2004
Posts: 12
Location: Netherlands

PostPosted: Sat Feb 07, 2004 12:25 pm    Post subject: Reply with quote

Thanks for your quick reply... I decided to start a new thread: https://forums.gentoo.org/viewtopic.php?p=843040#843040 because I think the problem lies with the apache-1 ebuilds not supporting LDAP. I would rather not install apache-2 if I don't have to... Maybe you have some suggestions as to how I can add LDAP support to apache-1?
Back to top
View user's profile Send private message
pens
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jan 2003
Posts: 121
Location: Irvine, CA

PostPosted: Sat Feb 07, 2004 5:45 pm    Post subject: Reply with quote

Is there any way to import Outlook/Mozilla/Evolution address books into the openldap database?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum