Search Suggest

How to install/Setup Zimbra Mail Server in CentOS 6/7



In this tutorial I am installing Zimbra version 8.7.1 Mail server in CentOS operating system based on production environment. As this is a stable version for production. Below are the server requirement to setup Zimbra Email server in step by step.

You will need your Public DNS access to setup MX and other record in DNS panel.
Create MX record and put MX host IP address as yours Public IP address (122.176.X.X) of your Mail server.

Server requirement
Operating system: CentOS 6/7 or other
Server Public IP address: 122.176.X.X
Server Local IP address: 192.168.35.141
Server Hostname:  mailzm.linuxsolution.in
Selinux: disabled
Firewalld/iptables rule: flush (Create your own rule as required)

Recommendation to configure /etc/hosts file as per below
# echo "192.168.35.141 mailzm.linuxsolution.in" >>/etc/hosts

# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.35.141 mailzm.linuxsolution.in

Setup DNS Server in your production server
DNS IP address: 192.168.35.141

Install bind/DNS package
# yum install bind bind-chroot bind-utils

Backup DNS default configuration file
# cp -rpf /etc/named.conf /etc/named.conf.bak

Edit /etc/named.conf file and changed highlighted parameter
# vim /etc/named.conf

options {
        listen-on port 53 { 127.0.0.1; 192.168.35.141;  };
        #listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        allow-query     { any; };      {Allow here only specific network as per requirement}
        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};
/* Add zone file here */

zone "linuxsolution.in" IN {
        type master;
        file "linux.zone";
        allow-update { none; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

Create Zone file

# cd /var/named
# vim linux.zone

$TTL    86400
@               IN SOA  linuxsolution.in. root.linuxsolution.in. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
                   IN NS           linuxsolution.in.
linuxsolution.in.  IN A            192.168.35.141
mailzm             IN A            192.168.35.141
linuxsolution.in.   IN MX   0       mailzm.linuxsolution.in.

Restart DNS service
On CentOS 6.X
# service named restart
# chkconfig named on

On centos 7
# systemctl restart named
# systemctl enable named

Make entry in /etc/resolved.conf file as per below
# echo "nameserver 192.168.35.141" >/etc/resolv.conf
# cat /etc/resolv.conf
nameserver 192.168.35.141

Test DNS
# nslookup linuxsolution.in
Server:         192.168.35.141
Address:        192.168.35.141#53

Name:   linuxsolution.in
Address: 192.168.35.141

Check MX record
# host -t mx linuxsolution.in
linuxsolution.in mail is handled by 0 mailzm.linuxsolution.in.

Before installing zimbra make sure postfix service is disable.
On CentOS 7.X
# service postfix stop
# chkconfig postfix off

On CentOS 7.X
# systemctl stop postfix
# systemctl disable postfix

Download ZCS software from Website as per operating system.
https://www.zimbra.com/try/zimbra-collaboration-open-source/

Extract software
# tar -zvxf zcs-8.7.1_GA_1670.RHEL6_64.20161025035141.tgz
# cd zcs-8.7.1_GA_1670.RHEL6_64.20161025035141

Run installer script to start installation
We do not require to install any extra package before running zimbra installer, Zimbra installer download a Zimbra repo file and will install all the required package from internet automatically with the help of zimbra repo. It may be you installed your OS with minimal installation so, in this case you will require to install perl package to run the installer.


# ./install.sh

Operations logged to /tmp/install.log.VPss2Vjf
Checking for existing installation...
    zimbra-ldap...NOT FOUND
    zimbra-logger...NOT FOUND
    zimbra-mta...NOT FOUND
    zimbra-dnscache...NOT FOUND
    zimbra-snmp...NOT FOUND
    zimbra-store...NOT FOUND
    zimbra-apache...NOT FOUND
    zimbra-spell...NOT FOUND
    zimbra-convertd...NOT FOUND
    zimbra-memcached...NOT FOUND
    zimbra-proxy...NOT FOUND
    zimbra-archiving...NOT FOUND
    zimbra-core...NOT FOUND


----------------------------------------------------------------------
PLEASE READ THIS AGREEMENT CAREFULLY BEFORE USING THE SOFTWARE.
SYNACOR, INC. ("SYNACOR") WILL ONLY LICENSE THIS SOFTWARE TO YOU IF YOU
FIRST ACCEPT THE TERMS OF THIS AGREEMENT. BY DOWNLOADING OR INSTALLING
THE SOFTWARE, OR USING THE PRODUCT, YOU ARE CONSENTING TO BE BOUND BY
THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS
AGREEMENT, THEN DO NOT DOWNLOAD, INSTALL OR USE THE PRODUCT.

License Terms for this Zimbra Collaboration Suite Software:
https://www.zimbra.com/license/zimbra-public-eula-2-6.html
----------------------------------------------------------------------



Do you agree with the terms of the software license agreement? [N] Y




Checking for installable packages

Found zimbra-core
Found zimbra-ldap
Found zimbra-logger
Found zimbra-mta
Found zimbra-dnscache
Found zimbra-snmp
Found zimbra-store
Found zimbra-apache
Found zimbra-spell
Found zimbra-memcached
Found zimbra-proxy



Use Zimbra's package repository [Y] Y
Importing Zimbra GPG key
Configuring package repository

Select the packages to install

Install zimbra-ldap [Y] Y

Install zimbra-logger [Y] Y

Install zimbra-mta [Y] Y

Install zimbra-dnscache [Y] n

Install zimbra-snmp [Y] Y

Install zimbra-store [Y] Y

Install zimbra-apache [Y] Y

Install zimbra-spell [Y] Y

Install zimbra-memcached [Y] Y

Install zimbra-proxy [Y] Y
Checking required space for zimbra-core
Checking space for zimbra-store
Checking required packages for zimbra-store
zimbra-store package check complete.

Installing:
    zimbra-core
    zimbra-ldap
    zimbra-logger
    zimbra-mta
    zimbra-snmp
    zimbra-store
    zimbra-apache
    zimbra-spell
    zimbra-memcached
    zimbra-proxy

The system will be modified.  Continue? [N] y
Installing packages

zimbra-core will be downloaded.
zimbra-ldap will be downloaded.
zimbra-logger will be downloaded.
zimbra-mta will be downloaded.
zimbra-snmp will be downloaded.
zimbra-store will be downloaded.
zimbra-apache will be downloaded.
zimbra-spell will be downloaded.
zimbra-memcached will be downloaded.
zimbra-proxy will be downloaded.
Downloading packages. This will not modify the system. This may take some time.

Removing /opt/zimbra
Removing zimbra crontab entry...done.
Cleaning up zimbra init scripts...done.
Cleaning up /etc/security/limits.conf...done.

Finished removing Zimbra Collaboration Server.

Local packages  zimbra-core zimbra-ldap zimbra-logger zimbra-mta zimbra-snmp zimbra-store zimbra-apache zimbra-spell zimbra-proxy selected for installation
Monitor /tmp/install.log.VPss2Vjf for package installation progress
Remote package installation started
Installing zimbra-core-components  zimbra-ldap-components zimbra-mta-components zimbra-snmp-components zimbra-store-components zimbra-apache-components zimbra-spell-components zimbra-memcached zimbra-proxy-components....done
Local package installation started
Installing  zimbra-core zimbra-ldap zimbra-logger zimbra-mta zimbra-snmp zimbra-store zimbra-apache zimbra-spell zimbra-proxy...done
done
Operations logged to /tmp/zmsetup.20170508-182155.log
Installing LDAP configuration database...done.
Setting defaults...

DNS ERROR resolving MX for mailzm.linuxsolution.in
It is suggested that the domain name have an MX record configured in DNS
Change domain name? [Yes] Create domain: [mailzm.linuxsolution.in]

DNS ERROR resolving MX for mailzm.linuxsolution.in
It is suggested that the domain name have an MX record configured in DNS

Re-Enter domain name? [Yes] Yes
Create domain: [mailzm.linuxsolution.in] linuxsolution.in
        MX: mailzm.linuxsolution.in (192.168.35.141)

        Interface: 192.168.35.141
        Interface: 127.0.0.1
        Interface: ::1
done.

Main menu

   1) Common Configuration:
   2) zimbra-ldap:                             Enabled
   3) zimbra-logger:                           Enabled
   4) zimbra-mta:                              Enabled
   5) zimbra-snmp:                             Enabled
   6) zimbra-store:                            Enabled
        +Create Admin User:                    yes
        +Admin user to create:                 admin@linuxsolution.in
******* +Admin Password                        UNSET
        +Anti-virus quarantine user:           virus-quarantine.iopydgzkd@linuxsolution.in
        +Enable automated spam training:       yes
        +Spam training user:                   spam.cuoo_mhmsh@linuxsolution.in
        +Non-spam(Ham) training user:          ham.eurcd4l2@linuxsolution.in
        +SMTP host:                            mailzm.linuxsolution.in
        +Web server HTTP port:                 8080
        +Web server HTTPS port:                8443
        +Web server mode:                      https
        +IMAP server port:                     7143
        +IMAP server SSL port:                 7993
        +POP server port:                      7110
        +POP server SSL port:                  7995
        +Use spell check server:               yes
        +Spell server URL:                     http://mailzm.linuxsolution.in:7780/aspell.php
        +Enable version update checks:         TRUE
        +Enable version update notifications:  TRUE
        +Version update notification email:    admin@linuxsolution.in
        +Version update source email:          admin@linuxsolution.in
        +Install mailstore (service webapp):   yes
        +Install UI (zimbra,zimbraAdmin webapps): yes

   7) zimbra-spell:                            Enabled
   8) zimbra-proxy:                            Enabled
   9) Default Class of Service Configuration:
   s) Save config to file
   x) Expand menu
   q) Quit

Type 6 option and then type 4 to change admin password
Address unconfigured (**) items (? - help) 6

Select, or 'r' for previous menu [r] 4
Password for admin@linuxsolution.in (min 6 characters): [6U79C2Cz] *******  (password here)
Store configuration

   1) Status:                                  Enabled
   2) Create Admin User:                       yes
   3) Admin user to create:                    admin@linuxsolution.in
   4) Admin Password                           set
   5) Anti-virus quarantine user:              virus-quarantine.iopydgzkd@linuxsolution.in
   6) Enable automated spam training:          yes
   7) Spam training user:                      spam.cuoo_mhmsh@linuxsolution.in
   8) Non-spam (Ham) training user:             ham.eurcd4l2@linuxsolution.in
   9) SMTP host:                               mailzm.linuxsolution.in
  10) Web server HTTP port:                    8080
  11) Web server HTTPS port:                   8443
  12) Web server mode:                         https
  13) IMAP server port:                        7143
  14) IMAP server SSL port:                    7993
  15) POP server port:                         7110
  16) POP server SSL port:                     7995
  17) Use spell check server:                  yes
  18) Spell server URL:                        http://mailzm.linuxsolution.in:7780/aspell.php
  19) Enable version update checks:            TRUE
  20) Enable version update notifications:     TRUE
  21) Version update notification email:       admin@linuxsolution.in
  22) Version update source email:             admin@linuxsolution.in
  23) Install mailstore (service webapp):      yes
  24) Install UI (zimbra,zimbraAdmin webapps): yes

Select, or 'r' for previous menu [r] r

Main menu

   1) Common Configuration:
   2) zimbra-ldap:                             Enabled
   3) zimbra-logger:                           Enabled
   4) zimbra-mta:                              Enabled
   5) zimbra-snmp:                             Enabled
   6) zimbra-store:                            Enabled
   7) zimbra-spell:                            Enabled
   8) zimbra-proxy:                            Enabled
   9) Default Class of Service Configuration:
   s) Save config to file
   x) Expand menu
   q) Quit

*** CONFIGURATION COMPLETE - press 'a' to apply
Select from menu, or press 'a' to apply config (? - help) a
Save configuration data to a file? [Yes] Yes
Save config in file: [/opt/zimbra/config.32648]        (Enter here)
Saving config in /opt/zimbra/config.32648...done.
The system will be modified - continue? [No] Yes
Operations logged to /tmp/zmsetup.20170508-182155.log
Setting local config values...done.
Initializing core config...Setting up CA...done.
Deploying CA to /opt/zimbra/conf/ca ...done.
Creating SSL zimbra-store certificate...done.
Creating new zimbra-ldap SSL certificate...done.
Creating new zimbra-mta SSL certificate...done.
Creating new zimbra-proxy SSL certificate...done.
Installing mailboxd SSL certificates...done.
Installing MTA SSL certificates...done.
Installing LDAP SSL certificate...done.
Installing Proxy SSL certificate...done.
Initializing ldap...done.
Setting replication password...done.
Setting Postfix password...done.
Setting amavis password...done.
Setting nginx password...done.
Setting BES searcher password...done.
Creating server entry for mailzm.linuxsolution.in...done.
Setting Zimbra IP Mode...done.
Saving CA in ldap...done.
Saving SSL Certificate in ldap...done.
Setting spell check URL...done.
Setting service ports on mailzm.linuxsolution.in...done.
Setting zimbraFeatureTasksEnabled=TRUE...done.
Setting zimbraFeatureBriefcasesEnabled=TRUE...done.
Checking current setting of zimbraReverseProxyAvailableLookupTargets
Querying LDAP for other mailstores
Searching LDAP for reverseProxyLookupTargets...done.
Adding mailzm.linuxsolution.in to zimbraReverseProxyAvailableLookupTargets
Setting TimeZone Preference...done.
Initializing mta config...done.
Setting services on mailzm.linuxsolution.in...done.
Adding mailzm.linuxsolution.in to zimbraMailHostPool in default COS...done.
Creating domain linuxsolution.in...done.
Setting default domain name...done.
Creating domain linuxsolution.in...already exists.
Creating admin account admin@linuxsolution.in...done.
Creating root alias...done.
Creating postmaster alias...done.
Creating user spam.cuoo_mhmsh@linuxsolution.in...done.
Creating user ham.eurcd4l2@linuxsolution.in...done.
Creating user virus-quarantine.iopydgzkd@linuxsolution.in...done.
Setting spam training and Anti-virus quarantine accounts...done.
Initializing store sql database...done.
Setting zimbraSmtpHostname for mailzm.linuxsolution.in...done.
Configuring SNMP...done.
Setting up syslog.conf...done.
Starting servers...done.
Installing common zimlets...
        com_zimbra_attachcontacts...done.
        com_zimbra_adminversioncheck...done.
        com_zimbra_attachmail...done.
        com_zimbra_ymemoticons...done.
        com_zimbra_date...done.
        com_zimbra_proxy_config...done.
        com_zimbra_clientuploader...done.
        com_zimbra_phone...done.
        com_zimbra_url...done.
        com_zimbra_tooltip...done.
        com_zimbra_cert_manager...done.
        com_zimbra_email...done.
        com_zimbra_webex...done.
        com_zimbra_bulkprovision...done.
        com_zimbra_mailarchive...done.
        com_zimbra_srchhighlighter...done.
        com_zimbra_viewmail...done.
Finished installing common zimlets.
Restarting mailboxd...done.
Creating galsync account for default domain...done.

You have the option of notifying Zimbra of your installation.
This helps us to track the uptake of the Zimbra Collaboration Server.
The only information that will be transmitted is:
        The VERSION of zcs installed (8.7.1_GA_1670_RHEL6_64)
        The ADMIN EMAIL ADDRESS created (admin@linuxsolution.in)

Notify Zimbra of your installation? [Yes] Yes
Notifying Zimbra of installation via http://www.zimbra.com/cgi-bin/notify.cgi?VER=8.7.1_GA_1670_RHEL6_64&MAIL=admin@linuxsolution.in

Notification complete
Setting up zimbra crontab...done.
Moving /tmp/zmsetup.20170508-182155.log to /opt/zimbra/log
Configuration complete - press return to exit
 

Installation setup is complete. Now you can check the zimbra server running status if services are running properly. You can now access Zimbra Admin panel in browser by using below URL.


Check Zimbra service status
Login with zimbra user
# su – zimbra
$ zmcontrol status
Host mailzm.linuxsolution.in
        amavis                  Running
        antispam                Running
        antivirus               Running
        ldap                    Running
        logger                  Running
        mailbox                 Running
        memcached               Running
        mta                     Running
        opendkim                Running
        proxy                   Running
        service webapp          Running
        snmp                    Running
        spell                   Running
        stats                   Running
        zimbra webapp           Running
        zimbraAdmin webapp      Running
        zimlet webapp           Running
        zmconfigd               Running

Access Zimbra Admin Panel
https://server-address:7071/


Đăng nhận xét