首页 » 邮件服务器 » Zimbra » 正文

CentOS6.5_x64安装Zimbra 8.7.1及服务器迁移

之前有写过一篇安装Zimbra8.5.1的教程,但是由于我们目前服务器放在阿里云北京区域对于全球或者说东南亚地区访问不利,延迟大有时无法接收有时无法发送,为了访问畅通所以对其进行迁移到阿里云香港,所以我在香港新购了一台服务器安装zimbra,此时Zimbra已经更新到了8.7.1,那么我就安装8.7.1顺便把版本也升级了,本篇包含安装+迁移+版本升级的内容,应该能适合绝大多数想迁移或想升级但又怕麻烦或出现问题的朋友。

 

本来我的想法是在香港安装好zimbra8.7.1后通过zimbra内置的迁移工具进行迁移,但是搞了半天也没有搞通,无奈我选择迂回路线采用人肉传送的方式进行迁移,大致步骤如下:

  1. 在北京先将zimbra8.5.1升级到8.7.1

  2. 在香港安装新的8.7.1

  3. 将北京停机,香港停机,把香港的/opt/zimbra/备份,然后把北京的/opt/zimbra/目录完整的同步到香港

  4. 启动香港zimbra服务并验证是否正常工作 

 

步骤一:升级北京zimbra从8.5.1到8.7.1

升级北京zimbra8.5.1到8.7.1。

升级步骤请看:https://www.chenxie.net/archives/1483.html

 

步骤二:在香港全新安装zimbra8.7.1

系统环境:阿里云香港地域 CentOS 6.5_x64

软件版本:Zimbra 8.7.1 

 

安装准备工作

安装须知:

1. zimbra不支持32位操作系统,请使用64位操作系统;

2. zimbra默认安装在/opt目录 ,所以请务必保证/opt目录有足够的空间,我是单独挂载的一块数据盘给/opt的。

3. zimbra在安装时要检测MX,所以要在之前配置好dns MX解析;

4. 关闭sendmail或postfix服务,避免25端口被占用,阿里云默认没有安装,如果有安装请执行以下:

/etc/init.d/sendmail stop

chkconfig sendmail off

 

/etc/init.d/postfix stop

chkconfig postfix off

 

安装前准备工作:

1. 关闭selinux,阿里云已经默认关闭所以就不管了;

2. 打开防火墙并开放以下端口,如果你在使用阿里云的安全组,那么请在安全组中开放这些端口

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 7071 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8087 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8443 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 110 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 143 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 993 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 995 -j ACCEPT

 

3. 配置主机名,编辑/etc/sysconfig/network

HOSTNAME=mail.chenxie.net

 

4. 配置hosts,编辑/etc/hosts

10.172.250.121 mail.chenxie.net

 

5. 重启一下操作系统保证配置都生效了。

# reboot

 

6. 安装dnsmasq 用于配置本地DNS,因为zimbra安装时要检测MX记录,由于域名的MX记录在生产上正在使用所以不能用生产的解析,等会儿使用本地解析。

# yum install dnsmasq bind-utils

 

配置dnsmasq:

添加以下到/etc/dnsmasq.conf

server=127.0.0.1

domain=chenxie.net

mx-host=chenxie.net,mail.chenxie.net,5

 

编辑/etc/resolv.conf ,将 nameserver 127.0.0.1 添加到原有的dns配置前面:

options timeout:1 attempts:1 rotate

nameserver 127.0.0.1

nameserver 10.143.22.116

nameserver 10.143.22.118

 

启动dnsmasq:

# /etc/init.d/dnsmasq start

 

测试:

[root@mail ~]# dig chenxie.net MX
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.47.rc1.el6_8.3 <<>> chenxie.net MX
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23313
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; QUESTION SECTION:
;chenxie.net.                     IN      MX
;; ANSWER SECTION:chenxie.net.              0       IN      MX      5 mail.chenxie.net.
;; ADDITIONAL SECTION:
mail.chenxie.net.         0       IN      A       10.172.54.1
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Nov 29 18:20:23 2016
;; MSG SIZE  rcvd: 73

 

开始安装

  1. 下载zimbra安装文件放置到/opt/software/目录下:

# cd /opt/software/

# wget https://files.zimbra.com/downloads/8.7.1_GA/zcs-8.7.1_GA_1670.RHEL6_64.20161025035141.tgz 

# tree /opt/

/opt/

└── software

    └── zcs-8.7.1_GA_1670.RHEL6_64.20161025035141.tgz

 

2. 解压文件并安装

# cd /opt/software/

# tar -zxf zcs-8.7.1_GA_1670.RHEL6_64.20161025035141.tgz 

# cd zcs-8.7.1_GA_1670.RHEL6_64.20161025035141

# ./install.sh

安装时会自动通过yum安装一些依赖包,我就不写了,视具体情况而定,以下是安装完依赖包后的步骤:

Operations logged to /tmp/install.log.sFgtLCfI

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] y

 

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-dnscache

    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-dnscache 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-dnscache zimbra-snmp zimbra-store zimbra-apache zimbra-spell zimbra-proxy selected for installation

Monitor /tmp/install.log.9nWB1XnZ for package installation progress

Remote package installation started

Installing zimbra-core-components  zimbra-ldap-components zimbra-mta-components zimbra-dnscache-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-dnscache zimbra-snmp zimbra-store zimbra-apache zimbra-spell zimbra-proxy…done

done

Operations logged to /tmp/zmsetup.20161201-103915.log

Installing LDAP configuration database…done.

Setting defaults…

 

DNS ERROR resolving MX for mail.chenxie.net

It is suggested that the domain name have an MX record configured in DNS

Change domain name? [Yes] yes

Create domain: [mail.chenxie.net] chenxie.net

        MX: mail.chenxie.net (10.172.54.1)

 

        Interface: 10.172.54.1

        Interface: 47.90.15.9

        Interface: 127.0.0.1

done.

Checking for port conflicts

Port conflict detected: 53 (zimbra-dnscache)

Port conflicts detected! – Press Enter/Return key to continue 

 

Main menu

 

   1) Common Configuration:                                                  

   2) zimbra-ldap:                             Enabled                       

   3) zimbra-logger:                           Enabled                       

   4) zimbra-mta:                              Enabled                       

   5) zimbra-dnscache:                         Enabled                       

   6) zimbra-snmp:                             Enabled                       

   7) zimbra-store:                            Enabled                       

        +Create Admin User:                    yes                           

        +Admin user to create:                 admin@chenxie.net               

******* +Admin Password                        UNSET                         

        +Anti-virus quarantine user:           virus-quarantine.ixdzg4jo@chenxie.net

        +Enable automated spam training:       yes                           

        +Spam training user:                   spam.enepraclvp@chenxie.net     

        +Non-spam(Ham) training user:          ham.vxwv4puwa@chenxie.net       

        +SMTP host:                            mail.chenxie.net                

        +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://mail.chenxie.net:7780/aspell.php

        +Enable version update checks:         TRUE                          

        +Enable version update notifications:  TRUE                          

        +Version update notification email:    admin@chenxie.net               

        +Version update source email:          admin@chenxie.net               

        +Install mailstore (service webapp):   yes                           

        +Install UI (zimbra,zimbraAdmin webapps): yes                           

 

   8) zimbra-spell:                            Enabled                       

   9) zimbra-proxy:                            Enabled                       

  10) Default Class of Service Configuration:                                

   s) Save config to file                                                    

   x) Expand menu                                                            

   q) Quit                                    

 

Address unconfigured (**) items  (? – help) 7

 

 

Store configuration

 

   1) Status:                                  Enabled                       

   2) Create Admin User:                       yes                           

   3) Admin user to create:                    admin@chenxie.net               

** 4) Admin Password                           UNSET                         

   5) Anti-virus quarantine user:              virus-quarantine.ixdzg4jo@chenxie.net

   6) Enable automated spam training:          yes                           

   7) Spam training user:                      spam.enepraclvp@chenxie.net     

   8) Non-spam(Ham) training user:             ham.vxwv4puwa@chenxie.net       

   9) SMTP host:                               mail.chenxie.net                

  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://mail.chenxie.net:7780/aspell.php

  19) Enable version update checks:            TRUE                          

  20) Enable version update notifications:     TRUE                          

  21) Version update notification email:       admin@chenxie.net               

  22) Version update source email:             admin@chenxie.net               

  23) Install mailstore (service webapp):      yes                           

  24) Install UI (zimbra,zimbraAdmin webapps): yes                           

 

Select, or ‘r’ for previous menu [r] 4

 

Password for admin@chenxie.net (min 6 characters): [TTHVZPfKt] chenxie.net.

 

Store configuration

 

   1) Status:                                  Enabled                       

   2) Create Admin User:                       yes                           

   3) Admin user to create:                    admin@chenxie.net               

   4) Admin Password                           set                           

   5) Anti-virus quarantine user:              virus-quarantine.ixdzg4jo@chenxie.net

   6) Enable automated spam training:          yes                           

   7) Spam training user:                      spam.enepraclvp@chenxie.net     

   8) Non-spam(Ham) training user:             ham.vxwv4puwa@chenxie.net       

   9) SMTP host:                               mail.chenxie.net                

  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://mail.chenxie.net:7780/aspell.php

  19) Enable version update checks:            TRUE                          

  20) Enable version update notifications:     TRUE                          

  21) Version update notification email:       admin@chenxie.net               

  22) Version update source email:             admin@chenxie.net               

  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-dnscache:                         Enabled                       

   6) zimbra-snmp:                             Enabled                       

   7) zimbra-store:                            Enabled                       

   8) zimbra-spell:                            Enabled                       

   9) zimbra-proxy:                            Enabled                       

  10) 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.6020] 

Saving config in /opt/zimbra/config.6020…done.

The system will be modified – continue? [No] yes

Operations logged to /tmp/zmsetup.20161201-103915.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 mail.chenxie.net…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 mail.chenxie.net…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 mail.chenxie.net to zimbraReverseProxyAvailableLookupTargets

Setting Master DNS IP address(es)…done.

Setting DNS cache tcp lookup preference…done.

Setting DNS cache udp lookup preference…done.

Setting DNS tcp upstream preference…done.

Setting TimeZone Preference…done.

Initializing mta config…done.

Setting services on mail.chenxie.net…done.

Adding mail.chenxie.net to zimbraMailHostPool in default COS…done.

Creating domain chenxie.net…done.

Setting default domain name…done.

Creating domain chenxie.net…already exists.

Creating admin account admin@chenxie.net…done.

Creating root alias…done.

Creating postmaster alias…done.

Creating user spam.enepraclvp@chenxie.net…done.

Creating user ham.vxwv4puwa@chenxie.net…done.

Creating user virus-quarantine.ixdzg4jo@chenxie.net…done.

Setting spam training and Anti-virus quarantine accounts…done.

Initializing store sql database…done.

Setting zimbraSmtpHostname for mail.chenxie.net…done.

Configuring SNMP…done.

Setting up syslog.conf…done.

Starting servers…done.

Installing common zimlets…

        com_zimbra_cert_manager…done.

        com_zimbra_phone…done.

        com_zimbra_mailarchive…done.

        com_zimbra_attachcontacts…done.

        com_zimbra_proxy_config…done.

        com_zimbra_bulkprovision…done.

        com_zimbra_srchhighlighter…done.

        com_zimbra_date…done.

        com_zimbra_clientuploader…done.

        com_zimbra_attachmail…done.

        com_zimbra_adminversioncheck…done.

        com_zimbra_viewmail…done.

        com_zimbra_email…done.

        com_zimbra_tooltip…done.

        com_zimbra_webex…done.

        com_zimbra_url…done.

        com_zimbra_ymemoticons…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@chenxie.net)

 

Notify Zimbra of your installation? [Yes] no

Notification skipped

Setting up zimbra crontab…done.

 

 

Moving /tmp/zmsetup.20161201-103915.log to /opt/zimbra/log

 

 

Configuration complete – press return to exit

 

安装完成。

 

普通用户访问地址:https://mail.chenxie.net/

管理员访问地址:https://mail.chenxie.net:7071/zimbraAdmin/

 

基本管理:

# su – zimbra

[zimbra@mail ~]$ zmcontrol start    //启动

[zimbra@mail ~]$ zmcontrol stop    //停止

[zimbra@mail ~]$ zmcontrol restart    //重启

[zimbra@mail ~]$ zmcontrol status    //查看服务状态

 

步骤三:停止北京和香港服务,进行/opt/zimbra目录迁移

# rsync -avzPO –delete /opt/zimbra/ root@ip:/opt/zimbra/

 

文件同步完成后在香港启动zimbra服务:

# /etc/init.d/zimbra start

 

最后修改MX记录,生效后就OK了。

 

 

 

 

 

 

 

 

 

发表评论

*