ZCP on Ubuntu 8.04 LTS

From Zarafa wiki

Revision as of 19:20, 25 November 2010 by Ddebyttere (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This document describes how I installed the Zarafa Collaboration Platform (ZCP) version 6.30.6 (build 17979) from the Canonical Partner Repository on Ubuntu 8.04 LTS (Long Term Support, till 2013). In this document you find detailed instructions for setting up ZCP, MySQL, Postfix (for routing and delivery of email), OpenLDAP (a database for user and group management), phpLDAPadmin (a web-based front-end to LDAP) and integrating them nicely to a whole.

You need some experience with Linux administration tasks in order to complete this guide, mainly simple command line skills.

Contents

Ground work: Setting up Ubuntu 8.04

I used a server VM image from thoughtpolice, but you can also start with a native install of Ubuntu 8.04.

I found my VMWare image here: http://www.thoughtpolice.co.uk/vmware/

wget http://downloads.sourceforge.net/project/thoughtpolicevm/Ubuntu/ubuntu-server-8.04.1/ubuntu-server-8.04.1-i386.zip
unzip ubuntu-server-8.04.1-i386.zip

Start VMWare Player, hit "Open a Virtual Machine", and select the .vmx file we just unzipped. Hit "Play" and say this VM is copied.

Logged in as "nonroot", the default user. Changed password to "password". Then I installed ZCP 6.30.6 and a bunch of additional tools:

sudo /etc/apt/sources.list  # uncomment the lines for the "partner" repositories that Zarafa is a part of.
sudo aptitude update
sudo aptitude safe-upgrade  # upgrades the system, includes a new kernel, therefore reboot
sudo apt-get install ssh openssh-server  # so we can log in with an ssh client ("putty" is a favorite on windows)
reboot  # reboot and log in again on the updated kernel
ip addr  # to find the ipaddress ubuntu is listening on, as we want log in over ssh

Logged in over ssh (on linux: "ssh nonroot@10.0.0.111", from windows try putty), as I don't like working from the fixed size VMware player.

Installing the ZCP

From the command line on your fresh Ubuntu 8.04 install do:

sudo aptitude install zarafa zarafa-dbg zarafa-libs zarafa-webaccess zarafa-webaccess-mobile zarafa-webaccess-muc
# We're requested to pick a password for the "root" user of the MySQL database, I picked "password".

sudo vi /etc/zarafa/server.cfg  # set the db password to "password"
sudo /etc/init.d/zarafa-server start  # bring up the server

Next, check if the Zarafa Storage Server created the tables it needs. It should show a list of ~20 tables)

mysql -u root -p  # "password" is our pass

Run the following command:

mysql> use zarafa;
mysql> show tables;
mysql> exit

Then create a public store (it's important to do so before adding users), and 2 test users

sudo zarafa-admin -s
sudo zarafa-admin -c foo -p password -f "Foo Flanders" -e "foo@localhost.tld"
sudo zarafa-admin -c bar -p password -f "Bar Baracus"  -e "bar@localhost.tld"

Now fire your browser (outside the VM) and point it to the IP address of the VM, with the WebAccess dir. In my case:

http://10.0.0.111/webaccess

The Zarafa Collaboration Platform has installed itself properly in Apache (the webserver), you you should be able to run the WebAccess, login with the test users. You cannot send and receive mail yet (see the rest of this document), but the basics work...

Congratulations.

OpenLDAP

So lets move on to LDAP (OpenLDAP) for managing users. So far we've let zarafa manage its users by a database table, if that's enough for you you can safely skip this step.

Besides OpenLDAP we also install phpldapadmin, a webbased frontend to ldap. When you do this you're asked to pick an administrator password. For sake of tradition I choose "password".

sudo aptitude install slapd ldap-utils libldap-2.4-2 phpldapadmin

Then we make OpenLDAP aware fo Zarafa:

sudo gunzip -c /usr/share/doc/zarafa/zarafa.schema.gz > /etc/ldap/zarafa.schema
# the following adds an include statement to ldap.conf for zarafa.schema
sudo sh -c 'echo "\n# Zarafa\ninclude /etc/ldap/zarafa.schema" >> /etc/ldap/slapd.conf'

Next we setup phpLDAPadmin, a web front-end to LDAP. It is possible to manage LDAP from the command line, but it's hard. Therefore an LDAP front-end is often used to administer it.

First find "memory_limit" and change it from 16M to 64M or phpLDAPadminwill not work:

sudo vi /etc/php5/apache2/php.ini

Then install it an restart the services:

sudo ln -s /usr/share/phpldapadmin /var/www/phpldapadmin
sudo /etc/init.d/apache2 restart
sudo /etc/init.d/slapd restart

Point you browser to http://10.0.0.111/phpldapadmin (replace 10.0.0.111 with your the IP address of the system your installing to or "localhost" if you've installed it locally), and follow these 4+14 steps to make users:

  1. Click on this "Create new entry here" (visible after clicking the "+" in the tree on the left)
  2. Select "Posix Group"
  3. I named the group "zarafa-users"
  4. Save changes

The following steps have do be done for each user-account:

  1. Open our newly created group "zarafa-users"
  2. Click "Create a child entry"
  3. Select "User Account"
  4. Fill at least: First name, Last name, User ID, and the Password
  5. Select the created group as GID Number "zarafa-users"
  6. Do not bother much with the other fields like 'Home directory'
  7. Hit "Create Object"
  8. Find the "objectClass" property on your new user and click "(add value)"
  9. Pick "zarafa-user" and save your changes
  10. Open your user and click "Add new attribute" (on top of the page)
  11. Set the "zarafaAccount" attribute to "1" and hit "Add"
  12. Open your user and click "Add new attribute" (on top of the page)
  13. Set the "mail" attribute to the full email address (e.g.: "foo@localhost.tld") of that user and hit "Add"
  14. To create mail aliasses simply add more "mail" attributes (hit the "(add value)" link under the current mail attribute), but this time provide the email address WITHOUT the domain (e.g.: leave out "@example.org")

I created 2 users along the lines of:

Foo Flanders, User Name= fflanders, uidNumber= 1000, zarafaAccount= 1, mail= fflanders@localdomain.tld, mail= foo
Bar Baracus, User Name= bbaracus, uidNumber= 1001, zarafaAccount= 1, mail= bbaracus@localdomain.tld, mail= bar

Their passwords are set to "password" (yes, it gets boring).

Lets first delete the users we've created before (the non-LDAP users we created in the first section):

sudo zarafa-admin -d foo
sudo zarafa-admin -d bar

Now set up Zarafa to look at ldap for its users:

In /etc/zarafa/server.cfg set:

user_plugin             = ldap
user_plugin_config      = /etc/zarafa/ldap.cfg

Now copy the standard openldap config file:

sudo cp /etc/zarafa/ldap.openldap.cfg /etc/zarafa/ldap.cfg

And set:

ldap_bind_user = cn=admin,dc=localdomain
ldap_bind_passwd = password
ldap_user_search_base = cn=zarafa-users,dc=localdomain

We're not making any groups for now... Please refer to the manual if you'd like to do so.

sudo /etc/init.d/zarafa-server restart
sudo zarafa-admin -l

Fire up your browser, point it to the WebAccess and confrim you can login as "fflanders".

We can now manage user accounts from LDAP, like the big boys do.


Postfix

Next is Postfix. In theory one can use any MTA with ZCP, but Postfix has become the most default option.

Fist lets install it:

sudo aptitude install postfix postfix-ldap

This raises a few questions: select defaults for "Internet site" and set "System mail name" to "localdomain".

Make sure /etc/postfix/ldap-aliases looks like:

alias_maps = hash:/etc/aliases, ldap:/etc/postfix/ldap-aliases
server_host = localhost
# please enter the full dn of the "mailusers"-Group:
search_base = cn=zarafa-users,dc=localdomain
query_filter = mail=%s
result_attribute = uid

Add or modify the following lines in /etc/postfix/main.cf:

mydestination = localdomain.tld, localhost
local_recipient_maps =
mailbox_command = /usr/bin/zarafa-dagent "$USER"
mailbox_transport = zarafa:
zarafa_destination_recipient_limit = 1

And add at the end of /etc/postfix/master.cf:

zarafa unix - n n - 10 pipe
  flags= user=vmail argv=/usr/bin/zarafa-dagent ${user}

[^^ put the 2 spaces in at the beginning of the second line!]

Next we create the user 'vmail', this user delivers the mail from Postfix to ZCP:

sudo adduser vmail --disabled-login

in /etc/zarafa/server.cfg set:

local_admin_users       = root vmail

Now Postfix is set up for local delivery of mail, so users can sent mail to one-another. If you want to send mail to the rest of the internet you can (apart from many other approaches) relay the mail to, for instance, your ISPs smtp server.

To do so set your ISP's smtp server's hostname in /etc/postfix/main.cf:

relayhost = smtp.xs4all.nl

Replace "smtp.xs4all.nl" with the domain of the smtp server you use.

Personal tools