Zimbra Integration With Samba - Ubuntu Based (Similar To AD And Exchange)
Author: Mohamed Ghaleb <Mohamed_Ghaleb [at] msn [dot] com> (English and German only please)
This tutorial shows how to configure Zimbra Collaboration Server (ZCS) and Samba to act as a primary domain controller (PDC) that uses LDAP as a centralized database for authenticating users on Linux and Windows desktops.
It should enable you then to seamlessly integrate Zimbra into a corporate network based on Open Source server software. You can then use Zimbra Admin GUI to manage Samba accounts, groups and domains.
Before we start I want to say first that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!
Now you will need to have a DNS server before doing any step, if you don't have a DNS server you can have a look on that tutorial.
What you will need:
- Ubuntu 6.06 LTS iso image CD http://releases.ubuntu.com/6.06/ubuntu-6.06.2-server-i386.iso
- Internet connection
Why did I use Ubuntu 6.06 LTS? unfortunately so far Zimbra provides a package for Ubuntu 6.06 LTS and not 8.04, you can download Zimbra source from other community groups which is modified to be installed on Ubuntu 8.04 but I just preferred to go with the officially supported version, for samba it doesn't really matter as it's a different server but I used 6.06 also in this tutorial.
Steps 1 to 5 need to be done on both servers Zimbra and Samba!
1 - Basic OS InstallationI won't go through this part in deep details but all what we need to do here is to install Ubuntu 6.06 LTS, basic installation with nothing on it, it's important to make sure you have the correct IP configuration during the installation so that the sources.list file (used by apt-get) will be correctly configured, other wise we will need to configure it manually.
A small tip: if you see the following screen before your IP configuration then you have already passed the IP configuration it's recommended to press <Go Back> and choose configure network manually.
After that carry on with the installation normally and make sure you have an internet connection configured.
2 Enable The root Account
After the reboot you can log in with your previously created username (e.g. administrator). Because we have to run all the steps from this tutorial as root user, so we will enable the root account now.
sudo passwd root
and give root a password. Afterwards we will switch to root by running
3 Install The SSH Server (Optional)
apt-get install ssh
From now on you can use an SSH client such as PuTTY and connect from your workstation to your Ubuntu server and follow the remaining steps from this tutorial.
4 Make sure the Network configuration is OKThe IP Address below will depend on which server you are installing, my sample below is for my Zimbra server.
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 192.168.0.107 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.1
Please make sure your network configuration are set correctly, feel free to change that based on your network configuration.
Then restart your network:
Then edit /etc/hosts. Make it similar to this depending on your hostname and IP:
127.0.0.1 localhost.localdomain localhost 192.168.0.107 zimbra.tm.local zimbra # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts
echo zimbra.tm.local > /etc/hostname
Both should show zimbra.tm.local now.You need to redo Step 4 with the Samba Server.
5 - Edit /etc/apt/sources.list and update your installation
Edit /etc/apt/sources.list. Comment out or remove the installation CD from the file and make sure that the universe and multiverse repositories are enabled. It should look like this:
# # deb cdrom:[Ubuntu-Server 6.06.2 _Dapper Drake_ - Release i386 (20080110.1)]/ dapper main restricted #deb cdrom:[Ubuntu-Server 6.06.2 _Dapper Drake_ - Release i386 (20080110.1)]/ dapper main restricted deb http://de.archive.ubuntu.com/ubuntu/ dapper main restricted deb-src http://de.archive.ubuntu.com/ubuntu/ dapper main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://de.archive.ubuntu.com/ubuntu/ dapper-updates main restricted deb-src http://de.archive.ubuntu.com/ubuntu/ dapper-updates main restricted ## Uncomment the following two lines to add software from the 'universe' ## repository. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## universe WILL NOT receive any review or updates from the Ubuntu security ## team. deb http://de.archive.ubuntu.com/ubuntu/ dapper universe deb-src http://de.archive.ubuntu.com/ubuntu/ dapper universe ## Uncomment the following two lines to add software from the 'backports' ## repository. ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. # deb http://de.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse # deb-src http://de.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu dapper-security main restricted deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted # deb http://security.ubuntu.com/ubuntu dapper-security universe # deb-src http://security.ubuntu.com/ubuntu dapper-security universe
Note: You don't need to enable the universe repository on the Zimbra server, however it's required on the Samba server.
to update the apt package database and
to install the latest updates (if there are any) then reboot.
Steps 6 and 7 to be done on Zimbra server!
6 - Install ZimbraWe have first to download Zimbra:
We need then to install the requirements:
apt-get install libidn11 fetchmail libpcre3 libgmp3c2 libexpat1 libxml2 libstdc++6 libstdc++5 openssl libltdl3 perl curl libtie-ixhash-perl
Decompress the installation files:
tar -xvf zcs-5.0.6_GA_2313.UBUNTU6.20080522130240.tgz
Go into the source directory and start the installation:
You can then go on with the defaults EXCEPT for the following:
Note: Now let's say the server where you want to install zimbra is called ZIMBRA.TM.LOCAL so the server hostname is ZIMBRA and the domain is TM.LOCAL, for some reason zimbra installation thinks that your domain name is called ZIMBRA.TM.LOCAL which is not true, so it will contact the DNS asking for ZIMBRA.TM.LOCAL MX record which doesn't exist, you should only have MX record for TM.LOCAL, and thus during the installation you will get the following message:zimbra installation
DNS ERROR resolving MX for zimbra.tm.local
It is suggested that the domain name have an MX record configured in DNS
Change domain name? [Yes]
So yes we will go ahead and press Enter to change the domain name, you will then get the following:
Create Domain: [zimbra.tm.local]
Then you have to change the admin password, so when you see the following message:
Address unconfigured (**) items (? - help)
Type in 3 and press Enter.
Select, or 'r' for previous menu [r]
Type in 4 and press Enter.
After typing your password press Enter, you will get the following:
Select, or 'r' for previous menu [r]
Press Enter to get:
Select from menu, or press 'a' to apply config (? - help)
Now type a to apply changes and press Enter, everything else should then go with the defaults and the logical answers.
Ok now Zimbra is up and running, for testing you can try to access: https://192.168.0.107:7071/zimbraAdmin/ (change the IP to meet your server's IP) and log in with admin and the password you have configured during the installation (in our case howtoforge is the password).
Now you need to note down what is the LDAP password as we will need it during Samba installation, during Zimbra installation a user called zimbra is created, most of the zimbra commands can only be executed under the zimbra user, to switch to the zimbra user run the following as root.
su zimbraTo get the ldap password run the following as zimbra user:
zmlocalconfig -s zimbra_ldap_passwordYou should then get the following:
zimbra_ldap_password = 6Rf8hUwL
So your password is 6Rf8hUwL, it is a random password so you may get it differently.