Project

General

Profile

Support #427

Installing Zimbra Collaboration Server from Source on Ubuntu

Added by Daniel Curtis over 10 years ago. Updated about 9 years ago.

Status:
Suspended
Priority:
Normal
Assignee:
Category:
Mail Server
Target version:
-
Start date:
07/29/2014
Due date:
% Done:

60%

Estimated time:
8.00 h
Spent time:

Description

This guide is building the Zimbra Collaborative Suite 8.0.8 Open Source Edition on an Ubuntu 14.04 x64 virtual machine with 1GB of RAM.

Initial Setup

  • Add the Zimbra user:
    sudo mkdir /opt/zimbra
    sudo adduser --home /opt/zimbra zimbra
    sudo su - zimbra
    
  • Install git:
    apt-get install git
    
  • Obtain the git ssh access keys:
    mkdir -p /tmp/zimbra-git
    cd /tmp/zimbra-git
    wget http://files2.zimbra.com/downloads/git-fusion/zimbra-git-ssh.tgz
    tar xfz zimbra-git-ssh.tgz
    
  • Add the access keys to your own user account:
    cd ~/.ssh
    cp /tmp/zimbra-git/id_rsa_git* .
    
  • Add the following ~/.ssh/config. Create the file if it doesn't exist:
    Host zimbra-git
      User public
      Hostname git.zimbra.com
      IdentityFile ~/.ssh/id_rsa_git
      IdentitiesOnly yes
      Port 1067
    
  • Ensure the permissions on the config file are correct
    chmod 600 ~/.ssh/config
    

Obtaining the source to Zimbra Collaboration Suite

The source code for ZCS is retrieved from git.zimbra.com as described above.

  • To obtain the source:
    mkdir -p ~/git
    cd ~/git
    git clone git@zimbra-git:zimbra-foss
    

Source for the "main" branch

  • main is the development branch.

The 'main' branch, (often referred to as mainline) contains the latest code - if your interested in seeing pre-release software check it out.

It is constantly in flux (for instance we might stagger spec files to avoid the need to always rebuild ThirdParty), if you're hitting a error in the Zimbra build side the first thing to do is re-sync, as we typically resolve these fast.

It is the default branch in use after doing a checkout of zimbra-foss

Listing available branches

  • The zimbra-foss repo contains all the available release branches. You can obtain a list of the branches via:
    git branch -a
    

*! main-foss
remotes/origin/HEAD -> origin/main-foss
remotes/origin/frank-foss
remotes/origin/franklin-5010-foss
remotes/origin/franklin-5011-foss
remotes/origin/franklin-5012-foss
remotes/origin/franklin-5013-foss
remotes/origin/franklin-5014-foss
remotes/origin/franklin-5015-foss
remotes/origin/franklin-5016-foss
remotes/origin/franklin-5017-foss
remotes/origin/franklin-5018-foss
remotes/origin/franklin-5019-foss
remotes/origin/franklin-5020-foss

The branch with a * in front of it is your active checkout.

Changing the active checkout

To change the active branch, you use the git checkout command, and supply the release you are interested in.

  • For example, to switch to the IRONMAIDEN 8 release branch, one would execute:
    cd ~/git/zimbra-foss
    git checkout ironmaiden-foss
    

Updating an existing clone

  • To update an already existing clone:
    cd ~/git/zimbra-foss
    git pull
    

Prepare the Build Environment

  • Install some prerequisites and development packages:
    sudo apt-get install build-essential autoconf libtool perl5.14 gettext automake cmake flex bison software-properties-common python-software-properties unzip zlib1g zlib1g-dev expat libexpat1-dev libpopt0 libpopt-dev libmysqlclient-dev libcurl4-openssl-dev libsasl2-2 libgssapi3-heimdal libsasl2-modules-gssapi-heimdal libsasl2-dev libldap2-dev libpcre3  libpcre3-dev libltdl3-dev libbz2-dev bzip2 libbz2-1.0 apache2-dev php5-dev postfix-dev libdspam7-dev libopendkim-dev libncurses5-dev libidn11 curl fetchmail libgmp3-dev libxml2 libstdc++6 openssl libssl-dev libaio-dev liblwp-useragent-determined-perl
    
  • Install a few more dependencies, to be safe:
    sudo aptitude build-dep altermime amavisd-new apache2 aspell postfix-cluebringer libxml2 php5 openldap openssl rrdtool rsync sendmail snmp libtcmalloc-minimal4 zeromq mysql-server curl clamav cyrus-sasl2 postfix dspam opendkim
    
  • Now install a few 32-bit compatibility packages, if running on a 64 bit system:
    sudo apt-get install libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 libasound2:i386 libgtk2.0-0:i386 libxtst6:i386
    

Prepare JDK 7

  • Download JDK 7u60 locally then upload the local copy to the Zimbra server:
    scp -P 4440 ~/Downloads/jdk-7u60-linux-x64.tar.gz zimbra@zimbra.example.com:/opt/zimbra/
    
  • Next, on the Zimbra server, add JDK 7u60 to the Zimbra build path:
    cp ~/jdk-7u60-linux-x64.tar.gz ~/git/zimbra-foss/ThirdPartyBuilds/x86_64/java/jdk-1.7.0_60.tgz
    sudo cp ~/jdk-7u60-linux-x64.tar.gz /usr/local/
    sudo tar xzf /usr/local/jdk-1.7.0_60.tgz
    
  • Now, download JCE 6 locally, then upload the local copy to the Zimbra server:
    scp -P 4440 ~/Downloads/jce_policy-6.zip zimbra@zimbra.example.com:/opt/zimbra/
    
  • Add JCE 6 policy to the JDK 7u60 build path:
    cp jce_policy-6.zip ~/git/zimbra-foss/ThirdPartyBuilds/x86_64/java/
    cd ~/git/zimbra-foss/ThirdPartyBuilds/x86_64/java/
    unzip jce_policy-6.zip
    

Install Apache Ant

  • Install apache ant:
    cd /usr/local
    sudo wget http://mirror.cogentco.com/pub/apache//ant/binaries/apache-ant-1.9.4-bin.tar.gz
    sudo tar xzf apache-ant-1.9.4-bin.tar.gz
    sudo ln -s /usr/local/apache-ant-1.9.4 /usr/local/ant
    

Add Java and ANT to the system environment:

  • Make the following changes to the /etc/environment file:
    sudo vi /etc/environment
    

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/java/bin:/usr/local/ant/bin"

Fix a few linked object problems:

  • I needed to create a few symbolic links that Zimbra will be looking for:
    sudo ln -s /lib/x86_64-linux-gnu/libncurses.so.5 /usr/lib/libncurses.so
    sudo ln -s /lib/x86_64-linux-gnu/libz.so.1 /usr/lib/libz.so
    sudo ln -s /usr/lib/x86_64-linux-gnu/libltdl.so /usr/lib/libltdl.so
    sudo ln -s /lib/x86_64-linux-gnu/libpcre.so.3 /usr/lib/libpcre.so
    sudo ln -s /lib/x86_64-linux-gnu/libexpat.so.1 /usr/lib/libexpat.so
    sudo ln -s /lib/x86_64-linux-gnu/libpopt.so.0 /usr/lib/libpopt.so
    sudo ln -s /usr/lib/libperl.so.5.14 /usr/lib/libperl.so
    

Building Zimbra Collaboration Server

To build Zimbra Collaboration Server, the "buildZCSH.sh" script can be used, that is located in the ZimbraBuild directory after the checkout completes.

  • Since the server already has the various required binaries and libraries installed, run:
    cd ~/git/zimbra-foss/ZimbraBuild
    ./buildZCS.sh -t
    
  • I used the following CPAN repository, since I am not a fan of yahoo (the default):

http://ftp.osuosl.org/pub/CPAN/

Resources


Files

jre-7u60-linux-x64.tar.gz (44.8 MB) jre-7u60-linux-x64.tar.gz JRE 7u60 x64 Daniel Curtis, 07/29/2014 05:25 PM
jdk-7u60-linux-x64.tar.gz (136 MB) jdk-7u60-linux-x64.tar.gz JDK 7u60 Linux x64 Daniel Curtis, 07/30/2014 07:30 AM
jce_policy-6.zip (8.89 KB) jce_policy-6.zip JCE 6 Daniel Curtis, 07/30/2014 07:41 AM

Also available in: Atom PDF