INSTALL.txt 11.1 KB
Newer Older
1 2 3


Most of the official Zimbra docs still apply with this build, and the
4
administration scripts (zmcontrol and so on) work as described in:
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

        http://www.zimbra.com/community/documentation.html

Whenever the Zimbra guide refers to /opt/zimbra, we will use the 'zbuild/home' directory
that is created by running buildout.

The following scripts do not work because it is not possible or does not make sense to run them as non-root:

 - libexec/zmfixperms
 - libexec/zmsyslogsetup

The following optional packages will be created by the build, but cannot be
installed because they have not been completely modified and tested for buildout:

 - zimbra-apache
 - zimbra-logger
 - zimbra-memcached
 - zimbra-proxy
 - zimbra-snmp
 - zimbra-spell





=====================
How to install Zimbra
=====================

34
 *) Install Ubuntu 12.04.x 64 bit server with at least 2GB RAM / 15 GB HD
35

Marco Mariani's avatar
Marco Mariani committed
36 37 38
    For instance, you can download it from
    http://releases.ubuntu.com/precise/ubuntu-12.04.2-server-amd64.iso
    and just 'dd' the image to an USB key, then boot with it.
Marco Mariani's avatar
Marco Mariani committed
39

40

41
 *) Install additional packages
42 43 44 45 46 47 48 49 50 51 52 53

        # for slapos components
        sudo apt-get install python gcc g++ make uml-utilities bridge-utils linux-headers-$(uname -r) patch wget \
                python-dev libxml2-dev libxslt-dev 

        # for zimbra third party components
        sudo apt-get install libcloog-ppl0 libncurses5-dev gcc-multilib

        # misc
        sudo apt-get install git libcap2-bin sysstat netcat


54
 *) The /etc/hosts file must be configured as required by Zimbra - something like
55 56 57 58 59

        127.0.0.1       localhost
        #127.0.1.1      myserver
        192.168.0.118   myserver.mydomain.com myserver

Marco Mariani's avatar
Marco Mariani committed
60 61
    Note that we commented/removed the line with 127.0.1.1. This file is actually checked by the zmsetup.pl script
    to retrieve the host and domain names.
62 63


64
 *) DNS must be set up according to Zimbra documentation (myhost.mydomain.com has both A and MX records)
65 66


67
 *) The global limits for 'number of open files' must be increased from the default of 1024.
Marco Mariani's avatar
Marco Mariani committed
68 69
    Many maintenance scripts call 'ulimit -n 32768' - therefore the following must be added
    to /etc/security/limits.conf
70 71 72 73 74 75

        ----- cut here --------------------------------
        *                hard    nofile          32768
        *                soft    nofile          32768
        ----- cut here --------------------------------

Marco Mariani's avatar
Marco Mariani committed
76
    After this change, reboot the system to make it effective.
77 78


79
 *) System logging must be configured in order to have server monitoring from the admin interface
80

Marco Mariani's avatar
Marco Mariani committed
81
    The following must be uncommented in /etc/rsyslog.conf:
82 83 84 85 86 87 88 89 90 91 92 93

        ----- cut here ----------------
        # provides UDP syslog reception
        $ModLoad imudp
        $UDPServerRun 514
        
        # provides TCP syslog reception
        $ModLoad imtcp
        $InputTCPServerRun 514
        ----- cut here ----------------


94
 *) Set up authbind
95

Marco Mariani's avatar
Marco Mariani committed
96 97 98 99 100
        $ wget http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/zimbra:/software/zimbra/authbind_2.1.1_amd64.deb
        $ sudo dpkg -i authbind_2.1.1_amd64.deb
        $ sudo touch /etc/authbind/byport/{80,110,143,443,\!993,\!995}
        $ sudo chown `id -u`.`id -g` /etc/authbind/byport/{80,110,143,443,\!993,\!995}
        $ sudo chmod 755 /etc/authbind/byport/{80,110,143,443,\!993,\!995}
101

Marco Mariani's avatar
Marco Mariani committed
102
    Note that `id -u` and `id -g` are the user and group that will run Zimbra.
103 104


105
 *) Create the directory to contain zimbra build and clone the slapos repository.
106 107 108 109

        $ mkdir zbuild; cd zbuild
        $ git clone http://git.erp5.org/repos/slapos.git -b zimbra slapos

Marco Mariani's avatar
Marco Mariani committed
110 111 112
    You can use a different name for the directory 'zbuild'.
    From this point, we will refer to it as '/home/user/zbuild'
    NB: the user that runs the build MUST be the same that will run Zimbra.
113 114


115
 *) Create buildout.cfg
116 117 118 119 120 121 122 123 124 125

        $ echo -e "[buildout]\nextends = slapos/software/zimbra/buildout.cfg\ndevelop = slapos\n" >buildout.cfg

    In case of repeated builds (i.e. when debugging) you can improve performance by using a local
    repository for zimbra:

        $ git clone http://git.erp5.org/repos/zimbra.git -b authbind zimbra
        $ echo -e "[zimbra-sources]\nrepository = /home/user/zbuild/zimbra\n" >>buildout.cfg


126 127
 *) Build SlapOS and Java components

Marco Mariani's avatar
Marco Mariani committed
128
    Bootstrap and run buildout a first time without arguments:
129

Marco Mariani's avatar
Marco Mariani committed
130 131 132
        $ wget https://raw.github.com/buildout/buildout/1/bootstrap/bootstrap.py
        $ python bootstrap.py
        $ ./bin/buildout
133

Marco Mariani's avatar
Marco Mariani committed
134
    After some time, you should read:
135 136 137 138 139 140 141 142

        BUILD SUCCESSFUL
        [...]
        mkdir -p /home/user/zbuild/parts/zimbra-sources/ThirdPartyBuilds/x86_64/java/junixsocket
        cd /home/user/zbuild/parts/zimbra-sources/ThirdPartyBuilds/x86_64/java/junixsocket
        tar --extract --bzip2 --file /home/user/zbuild/parts/junixsocket/junixsocket-1.3-bin.tar.bz2 --wildcards '*.so' --strip-components=2'
        Unused options for junixsocket-sources: 'update-command'.

Marco Mariani's avatar
Marco Mariani committed
143
    You might see instead:
144 145 146 147 148 149 150 151 152 153 154

        BUILD FAILED
        /home/user/zbuild/parts/junixsocket__compile__/junixsocket-1.3/build.xml:411: Test org.newsclub.net.unix.SoTimeoutTest failed

        Total time: 24 seconds
        junixsocket: Command failed with exit code 1: /home/user/zbuild/parts/ant/bin/ant 
        junixsocket: Compilation error. The package is left as is at /home/user/zbuild/parts/junixsocket__compile__/junixsocket-1.3 where you can inspect what went wrong
        While:
          Installing junixsocket.
        Error: System error

Marco Mariani's avatar
Marco Mariani committed
155 156
    This happens sometimes, and is an unpredictable timing issue.
    Running buildout again fixes the problem.
157 158 159 160


 *) Build Zimbra components

Marco Mariani's avatar
Marco Mariani committed
161
    This is provided as a separate step to allow building and deploying on different machines.
162 163 164 165

        $ source environment.sh
        $ ./bin/buildout install zimbra-build

Marco Mariani's avatar
Marco Mariani committed
166
    Some Java warnings are expected.
167

Marco Mariani's avatar
Marco Mariani committed
168
    Third party libraries build with the messages:
169 170 171 172

        *** Building in openssl SUCCEEDED.
        ...
        *** Building in zeromq SUCCEEDED.
173

Marco Mariani's avatar
Marco Mariani committed
174
    If any of them shows FAILED, check the dependencies, then read the section "Partial third-party build"
175

Marco Mariani's avatar
Marco Mariani committed
176
    When buildout has finished, you should find the following files:
177 178 179 180 181 182 183 184 185 186 187 188 189

        $ ls parts/zimbra-sources/ZimbraBuild/amd64/*deb
        zimbra-apache_8.0.4.GA.5682.UBUNTU12.64_amd64.deb
        zimbra-core_8.0.4.GA.5682.UBUNTU12.64_amd64.deb
        zimbra-ldap_8.0.4.GA.5682.UBUNTU12.64_amd64.deb
        zimbra-logger_8.0.4.GA.5682.UBUNTU12.64_amd64.deb
        zimbra-memcached_8.0.4.GA.5682.UBUNTU12.64_amd64.deb
        zimbra-mta_8.0.4.GA.5682.UBUNTU12.64_amd64.deb
        zimbra-proxy_8.0.4.GA.5682.UBUNTU12.64_amd64.deb
        zimbra-snmp_8.0.4.GA.5682.UBUNTU12.64_amd64.deb
        zimbra-spell_8.0.4.GA.5682.UBUNTU12.64_amd64.deb
        zimbra-store_8.0.4.GA.5682.UBUNTU12.64_amd64.deb

Marco Mariani's avatar
Marco Mariani committed
190 191 192 193
    You may backup the .deb files to be sure you don't lose them by mistake (i.e. if you run
    this buildout step again, they will be deleted).
    If you want to install zimbra on another or multiple servers, you can skip this step
    by reusing the .deb files - but only if the username and path of the build directory are the same.
194 195


196
 *) Run the deployment section to install the .deb files
197

Marco Mariani's avatar
Marco Mariani committed
198
        $ ./bin/buildout install zimbra-deploy-all
199

Marco Mariani's avatar
Marco Mariani committed
200 201
    The files will not be really installed by dpkg, but uncompressed under the 'zbuild/home' directory.
    If setcap is required at this point (for ldap and postfix) a root password might be asked.
202 203


204
 *) Configure zimbra
205

Marco Mariani's avatar
Marco Mariani committed
206
    Be sure to have sourced the environment variables for SlapOS components
207

Marco Mariani's avatar
Marco Mariani committed
208
        $ source /home/user/zbuild/environment.sh
209

Marco Mariani's avatar
Marco Mariani committed
210
    and the ones that refer to Zimbra components:
211

Marco Mariani's avatar
Marco Mariani committed
212
        $ source /home/user/zbuild/home/.bashrc
213

Marco Mariani's avatar
Marco Mariani committed
214
    Now run the actual configuration script.
215

Marco Mariani's avatar
Marco Mariani committed
216
        $ cd /home/user/zbuild/home/; ZIMBRA_INSTALLED_PKGS="zimbra-core zimbra-ldap zimbra-mta zimbra-store" ./libexec/zmsetup.pl
217

Marco Mariani's avatar
Marco Mariani committed
218
    The last two lines are printed after running "buildout install zimbra-deploy-all".
219 220


221
 *) Fill the required options in the configuration menu.
222

Marco Mariani's avatar
Marco Mariani committed
223 224
    Usually, only an admin password is required: menu 3 and then 4.
    Other mandatory options (as in case of zimbra-deploy-store) are be marked by an asterisk.
Marco Mariani's avatar
Marco Mariani committed
225

Marco Mariani's avatar
Marco Mariani committed
226 227
    Refer to the official Zimbra documentation for this part of the setup.
    Here you can also change things like IPv4/IPv6, etc.
228

Marco Mariani's avatar
Marco Mariani committed
229 230
    After typing (a)pply, many configuration files, certificates, and databases are created.
    A verbose log will show up on the screen.
231

Marco Mariani's avatar
Marco Mariani committed
232 233
    At the end of this process, the log is copied in home/log/zmsetup.*.txt
    and the zimbra services are run.
234 235


236
 *) Check that zimbra is running:
Marco Mariani's avatar
Marco Mariani committed
237 238 239

        $ cd /home/user/zimbra-target/home/bin
        $ ./zmcontrol status
240 241 242
        antispam                Running
        [...]
        zmconfigd               Running
Marco Mariani's avatar
Marco Mariani committed
243

244
 *) You should now be able to connect to https://myserver.mydomain.com
Marco Mariani's avatar
Marco Mariani committed
245 246
    and send/receive emails, and log in to the administration interface
    (drop-down menu, top right).
247 248


249
 *) Before running any of the maintenance commands in bin/ or libexec/,
Marco Mariani's avatar
Marco Mariani committed
250
    the following files must be sourced by the shell:
251

Marco Mariani's avatar
Marco Mariani committed
252 253 254 255 256
        $ source /home/user/zbuild/environment.sh
        $ source /home/user/zbuild/home/.bashrc


To install a multi-server system, use the deploy-zimbra-ldap, deploy-zimbra-mta
257 258
and deploy-zimbra-store parts. Only the "configuration menu" part is different
and should be completed as described by the official documentation.
Marco Mariani's avatar
Marco Mariani committed
259 260 261



262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
=========================
Partial third-party build
=========================

If you need to build a single component in ThirdParty, maybe because it has failed
and want to investigate the reason, remember to load the environment.sh script first,
then run the proper makefile.

        $ source environment.sh
        $ cd parts/zimbra-sources/ThirdParty/mysql/
        $ make

Unfortunately, the scripts provide no generic way to interrupt and restart
a third party build without rebuilding everything. So, after fixing the problem,
you will have to rebuild all of the components.



Marco Mariani's avatar
Marco Mariani committed
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321
===========================
Further links and resources
===========================

http://www.zimbra.com/forums/installation/
http://wiki.zimbra.com/wiki/Main_Page
http://pm.zimbra.com/
http://www.zimbrafr.org/forum/topic/483-les-commandes-zimbra-qui-depannent/
http://wiki.zimbra.com/wiki/Logger_(ZCS_6.0.x_and_later)
http://wiki.zimbra.com/wiki/Zmprov_Examples
http://wiki.zimbra.com/wiki/Bulk_Provisioning



===============
Useful commands
===============

 - list all the admins:

        $ zmprov gaaa


 - reset the admin (or any other) password:

        $ zmprov sp <admin email address> <new password>


 - password recovery:

        $ zmlocalconfig -s | grep ldap_amavis_password
        $ zmlocalconfig -s | grep ldap_nginx_password
        $ zmlocalconfig -s | grep ldap_postfix_password
        $ zmlocalconfig -s | grep ldap_replication_password
        $ zmlocalconfig -s | grep ldap_root_password
        $ zmlocalconfig -s | grep zimbra_ldap_password


 - remove a mail store (i.e. when it has been added for testing)

        $ zmprov ds "myhost.mydomain.com"

Marco Mariani's avatar
Marco Mariani committed
322
   (must be run on the ldap server)
Marco Mariani's avatar
Marco Mariani committed
323 324 325


 - add ipv6 to an existing ipv4 install:
326

Marco Mariani's avatar
Marco Mariani committed
327 328 329
        $ zmprov ms zimbra1.cutedomain.co.uk zimbraIPMode both
        $ libexec/zmiptool
        $ zmcontrol restart
330