Building the software yourself

Revision as of 09:02, 28 April 2006 by Bluetoad (talk | contribs)

Ubuntu Breezy Source Build


After trying to build the source myself using readme_source.txt and and build_cvs_howto.txt, I decided there must be a better way. It was quite apparent that the processes for building the Third Party components in those HOWTOs hadn't been followed for quite some time. There were issues with Makefiles and the process was generally unwieldy.

Here is what I did on an Ubuntu 5.10 (Breezy) system. This process was performed on a laptop without DNS and then confirmed on a VMWare Ubuntu instance.

Since Ubuntu is a Debian based system, I downloaded the Debian Developer build from [1].

I successfully installed it using the Ubuntu Breezy Hack poLink titlested in the forums ([2]). I managed to get to the Zimbra login and use the system.

Then I went through a couple instances of trying to install the source using readme_source.txt and and build_cvs_howto.txt. As a result of getting that process to work, I ended up with something like the following packages installed. This may or not have a bearing on the process I will describe below.

sudo apt-get install sudo libidn11 curl fetchmail libgmp3c2 libxml2 libstdc++6 openssl sudo apt-get install libssl-dev sudo apt-get install ssl-cert sudo apt-get install zlib1g zlib1g-dev sudo apt-get install autoconf sudo apt-get install libpcre3 libpcre3-dev expat libpopt0 libpopt-dev sudo apt-get install bison flex sudo apt-get install libtool libltdl3-dev sudo apt-get install automake1.7 sudo apt-get install libbz2-dev bzip2 libbz2-1.0 sudo apt-get install libgmp3-dev sudo apt-get install curl libwww-dev libcurl3-dev sudo apt-get install libsasl2 libgssapi1-heimdal sudo apt-get install libsasl2-modules-gssapi-heimdal sudo apt-get install libxml-dev

The Process

1. Download the Debian Developer build from [3]. 2. Unpack the tarball 3. We'll build a new zimbra_core package for Ubuntu $ cd packages $ mkdir zimbra_core $ dpkg -x zimbra-core_3.1.0_GA_332.DEBIAN3.1_i386.deb zimbra_core $ cd zimbra_core $ dpkg -e ../zimbra-core_3.1.0_GA_332.DEBIAN3.1_i386.deb

Now apply Ubuntu patches as described below (I couldn't work out how to up load non-media files, would prefer to host the patches at

[4] [5]

$ patch -p0 <ubuntu1.patch patching file util/

$ cd packages/zimbra_core $ patch -p0 < ../../ubuntu2.patch patching file ./DEBIAN/control

$ cd .. $ mv zimbra-core_3.1.0_GA_332.DEBIAN3.1_i386.deb zimbra-core_3.1.0_GA_332.DEBIAN3.1_i386.deb.aside

$ dpkg -b zimbra_core zimbra-core_3.1.0_GA_332.DEBIAN3.1_i386.deb

Now /etc/debian_version needs to be edited to trick bin/ Add a blank line and then 3.1. The script in the forums did this as well.

$ cat /etc/debian_version testing/unstable



cd back up to the top of your zcs tree

$ sudo ./

Notes on installation questions

I did 2 installations. One on a VMWare Ubuntu Breezy VM with static IP and hostname in my local network DNS.

I also did an install where I used the host as localhost.localdomain with no DNS on my laptop. So either I kept or entered (can't remember) localhost.localdomain as the host when it said the host can not be resolved by DNS. In this case you need to run 'zmprov mcf zimbraMtaDnsLookupsEnabled FALSE' as the zimbra user after the installation has completed.

For the MX question I said no both times.

I set the admin password as directed by the script (option 6 then 4 etc)

Then you'll see stuff like the following for an almost successful installation

      • CONFIGURATION COMPLETE - press 'a' to apply

Select from menu, or press 'a' to apply config (? - help) a Save configuration data to a file? [Yes] Save config in file: [/opt/zimbra/config.8962] Saving config in /opt/zimbra/config.8962...Done The system will be modified - continue? [No] yes Operations logged to /tmp/zmsetup.log.8962 Setting local config values...Done Setting up CA...Done Creating SSL certificate...Done Initializing ldap...Done Saving CA in ldap...Done Installing SSL certificate...Done Creating server entry for Setting spell check URL...Done Setting service ports on Adding to zimbraMailHostPool in default COS...Done Installing zimlets... com_zimbra_phone... com_zimbra_amzn... com_zimbra_wikipedia... com_zimbra_tracking... com_zimbra_url... com_zimbra_ymaps... com_zimbra_xslt... Done Setting MTA auth host...Done Creating domain Creating user Creating user Setting spam training accounts...Done Creating user Creating postmaster alias...Done Initializing store sql database...Done Setting zimbraSmtpHostname for Initializing logger sql database...Done Initializing mta config...Done Configuring SNMP...Done Setting services on Setting up zimbra crontab...Done

You have the option of notifying Zimbra of your installation. This helps us to track the uptake of the Zimbra Collaboration Suite. The only information that will be transmitted is:

       The VERSION of zcs installed (3.1.0_GA_332_DEBIAN3.1)
       The ADMIN EMAIL ADDRESS created (

Notify Zimbra of your installation? [Yes] Notifying Zimbra of installation via

Notification complete

Starting servers...Done.

Operations logged to /tmp/zmsetup.log.8962

Configuration complete - press return to exit

Browse to see if Zimbra works


Browse to the Zimbra Administration console




and login with

admin@yourdomain and the password you set during installation.

Using the Admin console, you should create some more accounts for testing or add passwords to the accounts created during the installation.

The next thing is being able to deploy source. The ant scripts expect the Tomcat manager webapp to be listening on port 7070.

Now the Tomcat manager setup seemed broken so I modified that and also installed the developer version of the Tomcat server.xml file. This must be installed over since that file is used to overwrite server.xml.

Download the source tarball from ... and unpack it. Mine is in a directory zcs_src

zimbra@parker:~$ mv /opt/zimbra/tomcat/conf/ /opt/zimbra/tomcat/conf/ zimbra@parker:~$ cp ~peter/zimbra/zcs_src/ZimbraServer/conf/tomcat-5.5/server.xml /opt/zimbra/tomcat/conf/ zimbra@parker:~$ cd /opt/zimbra/tomcat/conf/Catalina/localhost/ zimbra@parker:~/tomcat/conf/Catalina/localhost$ cp -p manager.xml manager.xml.aside

Apply the following patch [6]

zimbra@parker:~/tomcat/conf/Catalina/localhost$ patch -p0 < ~peter/zimbra/tomcatManager.patch patching file manager.xml

Logout out as the zimbra user and log back in to pick up the new environment from the installation

as Zimbra edit ~/.bashrc

add lines CATALINA_HOME=/opt/zimbra/tomcat export CATALINA_HOME

zimbra@parker:~$ logout peter@parker:~$ sudo su - zimbra Password:

zimbra@parker:~$ tomcat restart

$ netstat -nat

and you should no longer see port 80 being used and port 7070 has a listener now

browse to zimbra


you don't need the domain to login as one of the users created above

Try sending some mail to an account you created or the one you have logged in as.

You'll need to hit "Get Mail" to refresh your Inbox.

Now, let's see if the tomcat manager is working

browse to


the html directory was a surprise to me. Took a while to find that. Login as zimbra with password zimbra.

If there is a login issue you should check /opt/zimbra/tomcat/conf/tomcat-users.zml against zcs_src/ZimbraServer/conf/tomcat-5.5/tomcat-users.xml. The Debian developer build at the moment shipped with the zimbra user set up in the manager role.

Modify some permissions

$ sudo chown peter:peter /opt/zimbra/conf/msgs/ $ chmod 644 /opt/zimbra/conf/msgs/ $ sudo chgrp zimbra /opt/zimbra/apache-tomcat-5.5.15/work/Catalina/localhost/zimbraAdmin/tldCache.ser peter@parker:~/zimbra/zcs_src/ZimbraServer$ sudo chmod g+w $_

peter@parker:~/zimbra/zcs_src$ cd ZimbraWebClient/ peter@parker:~/zimbra/zcs_src/ZimbraWebClient$ ls bin build build.xml img jars src WebRoot ZimbraWebClient.iml peter@parker:~/zimbra/zcs_src/ZimbraWebClient$ export JAVA_HOME=/opt/zimbra/javapeter@parker:~/zimbra/zcs_src/ZimbraWebClient$ export ANT_HOME=/opt/ant peter@parker:~/zimbra/zcs_src/ZimbraWebClient$ export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH

Now see if you can compile

$ ant

OK see if you can deploy

$ ant deploy

and also check


Browse to the zimbra app and see if it works.

$ cd ../ZimbraServer/

$ ant

$ ant service-deploy

That does crash Tomcat but you probably managed to deploy the webapp. Tomcat crashes on (see /opt/zimbra/tomcat/log/catalina.out)

Zimbra server reserving server socket port=110 bindaddr=null ssl=false Fatal error: terminating: PrivilegedServlet init failed Permission denied

       at Method)
       at com.zimbra.cs.util.NetUtil.newBoundServerSocket(
       at com.zimbra.cs.util.NetUtil.reserveServerSocket(
       at com.zimbra.cs.servlet.PrivilegedServlet.init(
       at javax.servlet.GenericServlet.init(
       at org.apache.catalina.core.StandardWrapper.loadServlet(
       at org.apache.catalina.core.StandardWrapper.load(
       at org.apache.catalina.core.StandardContext.loadOnStartup(
       at org.apache.catalina.core.StandardContext.start(
       at org.apache.catalina.core.ContainerBase.addChildInternal(
       at org.apache.catalina.core.ContainerBase.addChild(
       at org.apache.catalina.core.StandardHost.addChild(        at org.apache.catalina.startup.HostConfig.deployWAR(        at org.apache.catalina.startup.HostConfig.deployApps(
       at org.apache.catalina.startup.HostConfig.check(
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(
       at java.lang.reflect.Method.invoke(
       at org.apache.commons.modeler.BaseModelMBean.invoke(
       at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(
       at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(
       at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(
       at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(
       at org.apache.catalina.manager.ManagerServlet.check(
       at org.apache.catalina.manager.ManagerServlet.deploy(
       at org.apache.catalina.manager.ManagerServlet.doPut(
       at javax.servlet.http.HttpServlet.service(
       at javax.servlet.http.HttpServlet.service(
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(
       at org.apache.catalina.core.StandardWrapperValve.invoke(
       at org.apache.catalina.core.StandardContextValve.invoke(
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
       at org.apache.catalina.core.StandardHostValve.invoke(
       at org.apache.catalina.valves.ErrorReportValve.invoke(
       at org.apache.catalina.core.StandardEngineValve.invoke(
       at org.apache.catalina.valves.AccessLogValve.invoke(
       at org.apache.catalina.connector.CoyoteAdapter.service(
       at org.apache.coyote.http11.Http11Processor.process(
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(
       at org.apache.tomcat.util.threads.ThreadPool$

which makes sense since 110 (pop3) is a privileged port and you normally need to be root. I'm going to look at some UML or VServer way of doing this...

So for now I just do

zimbra@parker:~$ tomcat restart

until I work out why that works since I'm zimbra there.

Now to get the code into Eclipse was easy. I created separate projects for ZimbraWebClient, ZimbraServer and Ajax

Jump to: navigation, search