Create Zimbra Local Repository Using Ubuntu 16.04

A few days ago, I have trained about Zimbra to IT staffs in a company. But, I find a problem that their internet connection is slow.

We use Zimbra 8.8.9, and the processes are required to install the packages from the Zimbra repository.

The good news, Zimbra have allowed the user to create their local repository. You can sync it from repo.zimbra.com. Please, check it out:

Prerequisites

I use Ubuntu 16.04 as Zimbra repository, if you install Zimbra multi-server, you can place it on LDAP server. But, you can place it on another server, separate with Zimbra cluster

In this case, i only sync data for a client that using Ubuntu, if you want to use CentOS, please have a look at this link.

Step by Step

Below is the step if you want to create zimbra local repository:

Create Web Server

First of all, you can create a web server service in order to connect the repo and users. You can use nginx or apache2. In this sample, i use apache2 as a Web server services

apt install apache2

Edit /etc/apache2/sites-available/000-default.conf and change DocumentRoot to /var/www/

vi /etc/apache2/sites-available/000-default.conf

DocumentRoot /var/www/

Restart service apache2.

systemctl restart apache2

Synchronize Data from Zimbra Repo

In order to zimbra repo can be cloned. You need to install awscli.

apt install awscli

And sync data from zimbra repo:

cd /var/www/

# For Zimbra 8.8.9 OSE
aws s3 sync s3://repo.zimbra.com/apt/87 ./apt/87 --no-sign-request --delete aws s3 sync s3://repo.zimbra.com/apt/889 ./apt/889 --no-sign-request --delete

# For Zimbra 8.8.9 NE
aws s3 sync s3://repo.zimbra.com/apt/87 ./apt/87 --no-sign-request --delete aws s3 sync s3://repo.zimbra.com/apt/889 ./apt/889 --no-sign-request --delete aws s3 sync s3://repo.zimbra.com/apt/889-ne ./apt/889-ne --no-sign-request --delete

Keep the Repo Up To Date

To keep repo up to date you can sync the data every night using cron, use crontab -e to edit the cron:

# For Zimbra 8.8.9 OSE
30 3 * * * /usr/bin/aws s3 sync s3://repo.zimbra.com/apt/87 /var/repositories/apt/87 --no-sign-request --delete 30 3 * * * /usr/bin/aws s3 sync s3://repo.zimbra.com/rpm/87 /var/repositories/rpm/87 --no-sign-request --delete 30 3 * * * /usr/bin/aws s3 sync s3://repo.zimbra.com/apt/889 /var/repositories/apt/889 --no-sign-request --delete 30 3 * * * /usr/bin/aws s3 sync s3://repo.zimbra.com/rpm/889 /var/repositories/rpm/889 --no-sign-request --delete

# For Zimbra 8.8.9 NE
30 3 * * * /usr/bin/aws s3 sync s3://repo.zimbra.com/apt/87 /var/repositories/apt/87 --no-sign-request --delete 30 3 * * * /usr/bin/aws s3 sync s3://repo.zimbra.com/rpm/87 /var/repositories/rpm/87 --no-sign-request --delete 30 3 * * * /usr/bin/aws s3 sync s3://repo.zimbra.com/apt/889 /var/repositories/apt/889 --no-sign-request --delete 30 3 * * * /usr/bin/aws s3 sync s3://repo.zimbra.com/rpm/889 /var/repositories/rpm/889 --no-sign-request --delete 30 3 * * * /usr/bin/aws s3 sync s3://repo.zimbra.com/apt/889-ne /var/repositories/apt/889-ne --no-sign-request --delete 30 3 * * * /usr/bin/aws s3 sync s3://repo.zimbra.com/rpm/889-ne /var/repositories/rpm/889-ne --no-sign-request --delete

Configure the Client

First, add your sources repo:

# For 8.8.9 OSE
cat > /etc/apt/sources.list.d/zimbra.list << EOF deb [arch=amd64] https://repoip/apt/87 xenial zimbra deb [arch=amd64] https://repoip/apt/889 xenial zimbra deb-src [arch=amd64] https://repoip/apt/87 xenial zimbra EOF

# For 8.8.9 NE
cat > /etc/apt/sources.list.d/zimbra.list << EOF deb [arch=amd64] https://repoip/apt/87 xenial zimbra deb [arch=amd64] https://repoip/apt/889 xenial zimbra
deb [arch=amd64] https://repoip/apt/889-ne xenial zimbra deb-src [arch=amd64] https://repoip/apt/87 xenial zimbra EOF

Then, add repo key:

apt-key dv --keyserver keyserver.ubuntu.com --recv-keys 9BE6ED79

Finally, please check whether you zimbra repo are running well:

apt update
apt search zimbra-chat

If there appearing about Zimbra chat information, your repo is already configured 🙂

This article is reference to https://wiki.zimbra.com/wiki/Zimbra_Collaboration_repository

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.