<-- Back to Andy Balaam Home

MyAddressBook Home | User Guide | Developers | Demo site | Contact

User Guide Home | Install | Use | Email Programs | Other

MyAddressBook User Guide - Installing and setting up

The commands shown are for Ubuntu: Debian should be very similar, and on RPM-based systems the install command is yum install and the package names and paths may be slightly different. Contributions of documentation for non-Ubuntu systems will be gratefully accepted.

Acknowledgements: this procedure was constructed with extensive reference to and copying from http://www.brennan.id.au/20-Shared_Address_Book_LDAP.html and http://ubuntuforums.org/showthread.php?t=1313472.
PACKAGERS WANTED: could you convert this procedure into a .deb that did it all for you? If so, we'd love to hear from you!

Install the prerequisites

Note that MyAddressBook requires Python 2.6 or greater (not 3.x yet...). Most modern Linux distributions have this.

First, install an LDAP server, a web server and some Python libraries:

 sudo apt-get install slapd ldap-utils apache2 libapache2-mod-fastcgi python-ldap python-webpy

If you want to be able to upgrade from MyAddressBook version 1 do this too:

 sudo apt-get install python-mysqldb

Create an LDAP schema and user

If you already have an LDAP server, skip this section and read Connecting to an existing LDAP server.

Create a config file for your LDAP server:

 sudo gedit /etc/ldap/ldap.conf

Enter the following as the file contents, and save the file and close:

Edit another file:

 sudo gedit /etc/ldap/db.ldif

The contents of that one should be:

And another:

 /etc/ldap/addressbook.ldif

With these contents:

Now run these commands:

 sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/cosine.ldif
 sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/inetorgperson.ldif
 sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/nis.ldif

 sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/db.ldif

 ldapadd -x -D 'cn=admin,dc=myaddressbook,dc=sf,dc=net' -w 1234 -f /etc/ldap/addressbook.ldif

After all this you have created an address book in your LDAP server called addressbook, and a user called admin. Both of these are inside the domain dc=myaddressbook,dc=sf,dc=net. The admin user has permissions to add, delete and modify entries, and the password is 1234.

With these settings, MyAddressBook will work out of the box, with no config file. If you want to use a different domain, address book, username or password, modify the above accordingly. You can specify the settings you have chosen in MyAddressBook's config file.

Install MyAddressBook

Download the latest version of MyAddressBook and put the .tar.gz file into your home directory.

Install it like this:

 cd
 tar -xjf myaddressbook-*.tar.gz
 sudo mv myaddressbook-*/ /var/www/myaddressbook

Create a config file

If you modified the above scripts, you must create a config file:

 sudo cp /var/www/myaddressbook/myaddressbook.cfg.sample /etc/myaddressbook.cfg
 sudo gedit /etc/myaddressbook.cfg

The sample config file shows the default values - remove the initial '#' from each line that needs to be different, and edit it to set it to what you need.

If you left the files and commands exactly as shown above, you don't need a config file at all.

Check it works

Check it works like this:

 cd /var/www/myaddressbook
 ./myaddressbook-local.py

When you run this command, a URL will be printed out. Open this URL in your browser. If you can see an empty list of addresses, MyAddressBook is working.

Stop the process by pressing Ctrl-C in the terminal where you started it.

Configure Apache

If you are using lighttpd, skip this section and check out Configuring lighttpd.

Create a .htaccess file:

 sudo gedit /var/www/myaddressbook/.htacccess

And paste this into the editor and save and exit:

and another:

 sudo gedit /var/www/myaddressbook/static/.htacccess

containing this:

Restart Apache:

 sudo service apache2 restart

Check it really works

Open your web browser to http://localhost/myaddressbook. If you see an (empty) list of addresses, it's working! Check out Using MyAddressBook.

Edit | History | Print | Recent Changes | Search | Admin Page last modified on November 04, 2022, at 07:15 PM