This chapter serves as a quick installation guide for single servers.
The topics covered in this chapter are:
By the end of this chapter, the user should have a running Zimbra server on his Linux system.
Let's dive into the prerequisites for Zimbra:
libperl5.14
, libgmp3c2
, build-essential
, sqlite3
, sysstat
, and ntp
) should be installed beforehand.This book will need to make use of some specific information as input to the Zimbra installation process, which in most cases will be different for each user. Therefore, we will note some of the most frequently used ones in this section. Remember that you should specify your own values rather than using the arbitrary values that I have provided. The following is the list of assumptions used in this chapter:
mail
zimbra-essentials.com
abdelmonam
Z!mbra@dm1n
zimbrabook
To be able to understand the following sections—especially when we need to perform a configuration—the reader should know how to harness the vi Editor. If you don't, you should develop your skill set or use another editor instead.
You can find good basic training for the vi Editor at http://www.cs.colostate.edu/helpdocs/vi.html.
For the various system requirements, please refer to the following link:
If you are using another version of Zimbra, please check the relevant requirements on the Zimbra website.
As declared in the Assumptions section, we will use the Ubuntu server release 12.04.2 LTS 64-bit. You can download it from http://www.ubuntu.com/download/server.
Newbies in Ubuntu can follow the tutorial given at http://ubuntuserverguide.com/2012/05/how-to-install-ubuntu-server-12-04-lts-precise-pangolin-included-screenshot.html.
More advanced users and geeks who like to achieve perfection can follow the guide given at https://help.ubuntu.com/12.04/serverguide/serverguide.pdf.
Before starting the installation, keep in mind that for this book we made the following choices:
mail
; don't give the fully qualified domain name (mail.zimbra-essentials.com
). On the next screen, where it calls for the domain name, assign zimbra-essentials.com
(without the hostname).admin
and zimbra
. Whatever you choose, those credentials will be what you use to log in at the command line after finishing the installation process, and the same password will be the password for sudo
commands. Make sure you remember what you enter here!bind9
for a split DNS.Let's start the installation. Follow these steps:
mail
and then press Enter.admin
and zimbra
.The installation should have completed successfully.
Note that you can get the following frequently encountered error:
ERROR: Installation can not proceed. Please fix your /etc/hosts file to contain: <ip> <FQHN> <HN> Where <IP> is the ip address of the host, <FQHN> is the FULLY QUALIFIED host name, and <HN> is the (optional) hostname-only portion
To resolve this, see the result of the following command:
hostname --fqdn
The output should match the FQDN in the host's file, or it won't work.
Downloading the example code
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
In order to prepare the OS for the Zimbra installation, the following steps need to be performed:
sudo apt-get update sudo apt-get upgrade
sudo apt-get install libperl5.14 libgmp3c2 build-essential sqlite3 sysstat ntp
sudo /etc/init.d/apparmor stop sudo /etc/init.d/apparmor teardown sudo update-rc.d -f apparmor remove sudo aptitude remove apparmor apparmor-utils
Open the network interfaces file using the following command:
sudo vi /etc/network/interfaces
Then replace the following line:
iface eth0 inet dhcp
With:
iface eth0 inet static address 172.16.126.14 netmask 255.255.255.0 gateway 172.16.126.1 network 172.16.126.0 broadcast 172.16.126.255
Restart the network process by typing in the following:
sudo /etc/init.d/networking restart
Sanity test!
To verify that your network configuration is configured properly, type in ifconfig
and ensure that the settings are correct. Then try to ping any working website (such as google.com) to see if that works.
The following steps need to be performed for the DNS configuration:
sudo /etc/init.d/bind9 status
You should get the following:
* bind9 is running
This is because we installed it within the Ubuntu installation process. If you forgot to install it at that step, you should install it now using the following command:
sudo apt-get install bind9
hosts
file using the following:sudo vi /etc/hosts
And change the following:
127.0.0.1 localhost 127.0.1.1 mail
To:
127.0.0.1 localhost.localdomain localhost 172.16.126.14 mail.zimbra-essentials.com mail
sudo vi /etc/hostname
Edit it to the following:
mail.zimbra-essentials.com
sudo vi /etc/resolv.conf
But for Ubuntu 12.04, you should use the following:
sudo vi /etc/resolvconf/resolv.conf.d/base
Set the default settings to the following:
nameserver 127.0.0.1 nameserver 172.16.126.11 nameserver 8.8.8.8 domain zimbra-essentials.com search zimbra-essentials.com
sudo touch /var/cache/bind/db.zimbra-essentials.com sudo touch /var/cache/bind/db.126.16.172.in-addr.arpa sudo cp /etc/bind/named.conf.options /etc/bind/named.conf.options.backup sudo cp /etc/bind/named.conf.local /etc/bind/named.conf.local.backup sudo cp /etc/bind/named.conf.default-zones /etc/bind/named.conf.default-zones.backup
Note here that for the reverse DB, db.126.16.172.in-addr.arpa
, we put the first three octets of the IP address in the reversed order.
sudo /etc/init.d/bind9 stop
sudo vi /etc/bind/named.conf.options
And set the following:
options { directory "/var/cache/bind"; query-source address * port 53; forwarders { 8.8.8.8; # this is Google DNS }; # we use forwarders to forward DNS queries for external # DNS names to DNS servers outside of that network. auth-nxdomain no; # conform to RFC1035 listen-on-v6 { any; }; };
sudo vi /etc/bind/named.conf.local
And set the following:
acl internals { 127.0.0.0/8; # for localhost access 172.16.126.0/24; # for access from my LAN, set yours # you can add all internal networks you allow to # access your zimbra server in this section }; view "internal" { match-clients { internals; }; recursion yes; zone "zimbra-essentials.com" { type master; file "/var/cache/bind/db.zimbra-essentials.com"; }; zone "126.16.172.in-addr.arpa" { type master; file "/var/cache/bind/db.126.16.172.in-addr.arpa"; }; };
zone
file using the following:sudo vi /var/cache/bind/db.126.16.172.in-addr.arpa
And set the following:
$TTL 86400 @ IN SOA mail.zimbra-essentials.com. admin.zimbra-essentials.com. ( 201305301916 ; Serial (increment after edit) 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 86400) ; Negative Cache TTL NS mail.zimbra-essentials.com. 1 PTR mail.zimbra-essentials.com.
sudo vi /var/cache/bind/db.zimbra-essentials.com
And set the following:
; zimbra-essentials.com $TTL 86400 @ IN SOA mail.zimbra-essentials.com. admin.zimbra-essentials.com. ( 201305301921 ; Serial (increment after edit) 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800) ; Negative Cache TTL ; Define the nameservers and the mail servers @ IN NS 172.16.126.14. IN MX 10 mail.zimbra-essentials.com. IN A 172.16.126.14 mail IN A 172.16.126.14
sudo vi /etc/bind/named.conf.default-zones
And set the following:
acl internals-default { 127.0.0.0/8; // for access from localhost 172.16.126.0/24; // for access from my LAN, set yours }; view "internal-default" { match-clients { internals-default; }; recursion yes; zone "." { type hint; file "/etc/bind/db.root"; }; // be authoritative for the localhost forward and reverse zones, // and for broadcast zones as per RFC 1912 zone "localhost" { type master; file "/etc/bind/db.local"; }; zone "127.in-addr.arpa" { type master; file "/etc/bind/db.127"; }; zone "0.in-addr.arpa" { type master; file "/etc/bind/db.0"; }; zone "255.in-addr.arpa" { type master; file "/etc/bind/db.255"; }; };
sudo chown root:bind /var/cache/bind/db.* sudo chmod 0644 /var/cache/bind/db.*
sudo /etc/init.d/bind9 start
nslookup mail.zimbra-essentials.com
We should see that our internal DNS server (127.0.0.1) returned the result of our internal IP address (172.16.126.14) for our FQDN of mail.zimbra-essentials.com
.
abdelmonam@mail:~$ nslookup mail.zimbra-essentials.com Server: 127.0.0.1 Address: 127.0.0.1#53 Name: mail.zimbra-essentials.com Address: 172.16.126.14
dig zimbra-essentials.com mx
Ensure that you get the NOERROR
status along the output of this command. Verify that there is an MX record for your FQDN, an NS record for your internal IP, and an A record that links your FQDN to your internal IP.
abdelmonam@mail:~$ nslookup mail.zimbra-essentials.com Server: 127.0.0.1 Address: 127.0.0.1#53 Name: mail.zimbra-essentials.com Address: 172.16.126.14 abdelmonam@mail:~$ dig zimbra-essentials.com mx ; <<>> DiG 9.8.1-P1 <<>> zimbra-essentials.com mx ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53708 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1 ;; QUESTION SECTION: ;zimbra-essentials.com. IN MX ;; ANSWER SECTION: zimbra-essentials.com. 86400 IN MX 10 mail.zimbra-essentials.com. ;; AUTHORITY SECTION: zimbra-essentials.com. 86400 IN NS 172.16.126.14. ;; ADDITIONAL SECTION: mail.zimbra-essentials.com. 86400 IN A 172.16.126.14 ;; Query time: 3 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Thu May 30 20:22:34 2013 ;; MSG SIZE rcvd: 103
If you have some difficulties in configuring DNS, the following are three useful links:
3.133.157.142