Chapter 1. Single Server Installation

This chapter serves as a quick installation guide for single servers.

The topics covered in this chapter are:

  • The prerequisites for Zimbra
  • Preparing the environment
  • Downloading Zimbra (we will take an Ubuntu version as an example)
  • Installing and configuring Zimbra
  • Running Zimbra for the first time

By the end of this chapter, the user should have a running Zimbra server on his Linux system.

The prerequisites for Zimbra

Let's dive into the prerequisites for Zimbra:

  • Zimbra supports only 64-bit LTS versions of Ubuntu, release 10.04 and above. If you would like to use a 32-bit version, you should use Ubuntu 8.04.x LTS with Zimbra 7.2.3.
  • Having a clean and freshly installed system is preferred for Zimbra; it requires a dedicated system and there is no need to install components such as Apache and MySQL, since the Zimbra server contains all the components it needs. Note that installing Zimbra with another service (such as a web server) on the same server can cause operational issues.
  • The dependencies (libperl5.14, libgmp3c2, build-essential, sqlite3, sysstat, and ntp) should be installed beforehand.
  • Configure a fixed IP address on the server.
  • Have a domain name and a well-configured DNS (A and MX entries) that points to the server.

Preparing the environment

Certain things need to be kept in mind while preparing the environment.

Assumptions

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:

  • OS version: ubuntu-12.04.2-server-amd64
  • Zimbra version: zcs-8.0.3_GA_5664.UBUNTU12_64.20130305090204
  • OS server name: mail
  • Internet domain: zimbra-essentials.com
  • OS server IP address: 172.16.126.14
  • OS server IP subnet mask: 255.255.255.0
  • OS server IP gateway: 172.16.126.1
  • Internal DNS address: 172.16.126.11
  • External DNS address: 8.8.8.8
  • Ubuntu admin ID: abdelmonam
  • Ubuntu admin password: Z!mbra@dm1n
  • Zimbra admin password: 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.

System requirements

For the various system requirements, please refer to the following link:

http://www.zimbra.com/docs/os/8.0.2/single_server_install/wwhelp/wwhimpl/common/html/wwhelp.htm#href=SS_Install_8.0.2_OS.ZCS_System_Requirements.html&single=true

If you are using another version of Zimbra, please check the relevant requirements on the Zimbra website.

Installing the Ubuntu server

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:

  1. In this book, we will use a split DNS setup, in which the server resides on a DeMilitarized Zone (DMZ) and must resolve to its proper internal (DMZ subnet) IP address instead of the public IP address that is issued on the Internet. This is an environment where a firewall/router provides the address translation from the public IP (announced to the world) to the DMZ IP (also called DNAT, which stands for Destination Network Address Translation) so that translation is not known to the server itself. This configuration is recommended for security, but it makes pieces of the Zimbra setup more difficult than they might otherwise have been.
  2. The Ubuntu installation process wants to configure your local network using DHCP. You can accept it and then modify it after installation, but there is no need to do the job twice, so cancel it before it gets that far and then manually configure it with a static IP address (don't forget to replace the one we chose for this book with yours), netmask, and gateway. Don't use a public DNS for your nameserver configuration; rather, use the same IP address that you have assigned to the machine as its proper static IP (which will not allow you to resolve domain names on the Internet until we perform some more configurations later, but it saves unnecessary headaches later).
  3. When the installation prompts you for a hostname, configure only a one-word hostname, as we chose in the Assumptions section; in our case, it is 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).
  4. After finishing the base system installation step, the installer process will ask you for credentials (username and password for that user). You can use whatever username you want except 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!
  5. At the Software Selection screen, you must select DNS Server and OpenSSH Server for installation, no other options. This will authorize remote administration (SSH) and will mandatorily set up bind9 for a split DNS.

Let's start the installation. Follow these steps:

  1. First of all, choose the appropriate language.
  2. Choose Install Ubuntu Server and then press Enter.
  3. When it prompts for the hostname, type in mail and then press Enter.
  4. The hard disk setup is simple if you are using a single drive; however, in the case of a server, it's not the best way to do things. There are a lot of options for partitioning your drives. In our case, we just make a little partition (2x RAM) for swapping, and what remains will be used for the whole system. Others can recommend separate partitions for mailstore, system, and so on. Feel free to use the recommendation you want depending on your IT architecture; use your own judgment here or ask your IT manager.
  5. After finishing the partitioning task, you will be asked to enter the username and password; you can choose what you want except admin and zimbra.
  6. When asked if you want to encrypt the home directory, select No and then press Enter.
  7. Press Enter to accept an empty entry for the HTTP proxy.
  8. Choose Install security updates automatically and then press Enter.
  9. Highlight DNS server and OpenSSH server for installation. Press the Space bar to enable each choice, and finally press Enter to continue. Note that OpenSSH allows us to connect to the server remotely after installation.
  10. Select Yes and then press Enter to install the GRUB boot loader to the master boot record.

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.

Tip

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.

Preparing the OS (Ubuntu server) for the Zimbra installation

In order to prepare the OS for the Zimbra installation, the following steps need to be performed:

  1. Log in to the newly installed system and update and upgrade Ubuntu using the following commands:
    sudo apt-get update
    sudo apt-get upgrade
    
  2. Install the dependencies as follows:
    sudo apt-get install libperl5.14 libgmp3c2 build-essential sqlite3 sysstat ntp
    
  3. Zimbra recommends (but there's no obligation) to disable and remove Apparmor:
    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
    
  4. Set the static IP for your server as follows:

    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
    

Note

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.

DNS configuration

The following steps need to be performed for the DNS configuration:

  1. Type in the following command to ensure the BIND server is running:
    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
    
  2. Edit your 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
    
  3. Set a hostname for your server. Later, this will become the name of your Zimbra e-mail server.
    sudo vi /etc/hostname
    

    Edit it to the following:

    mail.zimbra-essentials.com
    
  4. In general, we edit DNS servers using the following:
    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
    
  5. Type in the following commands:
    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.

  6. Stop the DNS server using the following command:
    sudo /etc/init.d/bind9 stop
    
  7. Edit your DNS options using the following:
    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; };
    }; 
    

    Note

    The query-source address entry is to allow your server to hit the DNS if the DNS ports for outgoing requests are blocked. If you do not need it, you may leave it commented.

  8. Edit your local DNS file using the following:
    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";
            };
    }; 
    
  9. Edit your reverse 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. 
    
  10. Edit your zone file using the following:
    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 
    
  11. Since we used views, we should declare them in the default zone. Run the following command:
    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";
       };
    }; 
    
  12. Ensure all config files have the correct ownership and permissions:
    sudo chown root:bind /var/cache/bind/db.*
    sudo chmod 0644 /var/cache/bind/db.* 
    
  13. Start your DNS server using the following:
    sudo /etc/init.d/bind9 start
    
  14. Our DNS server should be working properly at this point. To verify this, run the following command:
    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
    
  15. Run the following command:
    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
    

    Note

    A proper DNS configuration is FUNDAMENTAL! Don't install Zimbra if your DNS is not working properly; installing Zimbra with an improperly working DNS may result in an install that can do everything except send mails, even from a Zimbra user to himself!

If you have some difficulties in configuring DNS, the following are three useful links:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.157.142