当前位置: 首页 > 工具软件 > Zimbra > 使用案例 >

CentOS 7.0安装Zimbra 8.7邮件服务器

楚宏胜
2023-12-01

## **CentOS 7.0安装Zimbra 8.7邮件服务器**

系统:Centos7
ip地址:192.168.0.233
安装前准备
1.关闭SELINUX并清空iptable规则
# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux
# yum -y install iptables-services
# iptables -F
# iptables -X
# iptables -Z
# service iptables save
# reboot
2.配置主机名
# hostnamectl set-hostname mail.zimbra.com
# echo "192.168.0.233  mail.zimbra.com" >> /etc/hosts
3.安装zimbra所需要的包和库
# yum -y update
# yum -y install perl perl-core nmap sudo libidn gmp libaio libstdc++ unzip sysstat sqlite nc
4.关闭安装的MTA服务
# systemctl stop postfix.service
# systemctl disable postfix.service
配置dns服务器
1.安装bind
# yum -y install bind bind-utils
2.修改主配置文件
vim /etc/named.conf
添加下面的配置:
zone "zimbra.com" IN {
        type master;
        file "zimbra.com";
        allow-update { none; };
};
zone "127.168.192.in-addr.arpa" IN {
        type master;
        file "192.168.0.arpa";
        allow-update { none; };
};
2.配置区域配置文件
# vim /var/named/zimbra.com

$TTL 1D
@	IN SOA	@ rname.invalid. (
					0	; serial
					1D	; refresh
					1H	; retry
					1W	; expire
					3H )	; minimum
	NS	ns.zimbra.com.
	MX 10	mail.zimbra.com.
ns	A	192.168.0.233
mail	A	192.168.0.233

# vim /var/named/192.168.0.arpa

$TTL 1D
@       IN SOA  @ rname.invalid. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS      ns.zimbra.com.
109     PTR     ns.zimbra.com.
109     PTR     mail.zimbra.com.
3.重启bind
# systemctl restart named.service
4.使用本地dns服务器
# echo "nameserver 127.0.0.1" >> /etc/resolv.conf
安装zimbra
1.下载zimbra
# wget https://files.zimbra.com/downloads/8.6.0_GA/zcs-8.6.0_GA_1153.RHEL7_64.20141215151110.tgz
2.解压压缩包并修改文件夹名
# tar -zxvf zcs-8.6.0_GA_1153.RHEL7_64.20141215151110
# mv zcs-8.6.0_GA_1153.RHEL7_64.20141215151110 zimbra
3.运行脚本开始安装zimbra
# cd zimbra
# ./install.sh --platform-override

Operations logged to /tmp/install.log.2744
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.
ZIMBRA, INC. ("ZIMBRA") 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 the Zimbra Collaboration Suite:
  http://www.zimbra.com/license/zimbra-public-eula-2-5.html



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



Checking for prerequisites...
     FOUND: NPTL
     FOUND: nmap-ncat-6.40-7
     FOUND: sudo-1.8.6p7-17
     FOUND: libidn-1.28-4
     FOUND: gmp-6.0.0-12
     FOUND: libaio-0.3.109-13
     FOUND: libstdc++-4.8.5-4
     FOUND: unzip-6.0-15
     FOUND: perl-core-5.16.3-286

Checking for suggested prerequisites...
     FOUND: perl-5.16.3
     FOUND: sysstat
     FOUND: sqlite
Prerequisite check complete.

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


Select the packages to install

Install zimbra-ldap [Y] 

Install zimbra-logger [Y] 

Install zimbra-mta [Y] 

Install zimbra-dnscache [Y] n

Install zimbra-snmp [Y] 

Install zimbra-store [Y] 

Install zimbra-apache [Y] 

Install zimbra-spell [Y] 

Install zimbra-memcached [Y] 

Install zimbra-proxy [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

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

Finished removing Zimbra Collaboration Server.

Installing packages

    zimbra-core......zimbra-core-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-ldap......zimbra-ldap-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-logger......zimbra-logger-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-mta......zimbra-mta-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-snmp......zimbra-snmp-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-store......zimbra-store-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-apache......zimbra-apache-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-spell......zimbra-spell-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-memcached......zimbra-memcached-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-proxy......zimbra-proxy-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
Operations logged to /tmp/zmsetup04082016-205457.log
Installing LDAP configuration database...done.
Setting defaults...

DNS ERROR resolving MX for mail.zimbra.com
It is suggested that the domain name have an MX record configured in DNS
Change domain name? [Yes] 
Create domain: [mail.zimbra.com] zimbra.com
	MX: mail.zimbra.com (192.168.0.233)(搭建的时候这儿不一样,不清楚原因)

	Interface: 127.0.0.1
	Interface: ::1
	Interface: 192.168.0.233
done.
Checking for port conflicts

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@zimbra.com              
******* +Admin Password                        UNSET                         
        +Anti-virus quarantine user:           virus-quarantine.vhwa2pqsa7@zimbra.com
        +Enable automated spam training:       yes                           
        +Spam training user:                   spam.jqlkpspj@zimbra.com      
        +Non-spam(Ham) training user:          ham.jztdgrii_b@zimbra.com     
        +SMTP host:                            mail.zimbra.com               
        +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.zimbra.com:7780/aspell.php
        +Enable version update checks:         TRUE                          
        +Enable version update notifications:  TRUE                          
        +Version update notification email:    admin@zimbra.com              
        +Version update source email:          admin@zimbra.com              
        +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                                    

Address unconfigured (**) items  (? - help) 6


Store configuration

   1) Status:                                  Enabled                       
   2) Create Admin User:                       yes                           
   3) Admin user to create:                    admin@zimbra.com              
** 4) Admin Password                           UNSET                         
   5) Anti-virus quarantine user:              virus-quarantine.vhwa2pqsa7@zimbra.com
   6) Enable automated spam training:          yes                           
   7) Spam training user:                      spam.jqlkpspj@zimbra.com      
   8) Non-spam(Ham) training user:             ham.jztdgrii_b@zimbra.com     
   9) SMTP host:                               mail.zimbra.com               
  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.zimbra.com:7780/aspell.php
  19) Enable version update checks:            TRUE                          
  20) Enable version update notifications:     TRUE                          
  21) Version update notification email:       admin@zimbra.com              
  22) Version update source email:             admin@zimbra.com              
  23) Install mailstore (service webapp):      yes                           
  24) Install UI (zimbra,zimbraAdmin webapps): yes                           

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

Password for admin@zimbra.com (min 6 characters): [5okG5xTdX] 123456

Store configuration

   1) Status:                                  Enabled                       
   2) Create Admin User:                       yes                           
   3) Admin user to create:                    admin@zimbra.com              
   4) Admin Password                           set                           
   5) Anti-virus quarantine user:              virus-quarantine.vhwa2pqsa7@zimbra.com
   6) Enable automated spam training:          yes                           
   7) Spam training user:                      spam.jqlkpspj@zimbra.com      
   8) Non-spam(Ham) training user:             ham.jztdgrii_b@zimbra.com     
   9) SMTP host:                               mail.zimbra.com               
  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.zimbra.com:7780/aspell.php
  19) Enable version update checks:            TRUE                          
  20) Enable version update notifications:     TRUE                          
  21) Version update notification email:       admin@zimbra.com              
  22) Version update source email:             admin@zimbra.com              
  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] 
Save config in file: [/opt/zimbra/config.11982] 
Saving config in /opt/zimbra/config.11982...done.
The system will be modified - continue? [No] yes
Operations logged to /tmp/zmsetup04082016-205457.log
Setting local config values...done.
Initializing core config...Setting up CA...done.
Deploying CA to /opt/zimbra/conf/ca ...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.6.0_GA_1153_RHEL7_64)
	The ADMIN EMAIL ADDRESS created (admin@zimbra.com)

Notify Zimbra of your installation? [Yes] no
Notification skipped
Setting up zimbra crontab...done.


Moving /tmp/zmsetup04082016-205457.log to /opt/zimbra/log


Configuration complete - press return to exit 
4.启动zimbra并查看状态
# su - zimbra        //切换到zimbra用户
# zmcontrol start    //启动zimbra

# zmcontrol status   //查看启动状态
# zmcontrol stop     //停止zimbra
查看zimbra启动状态:

5.访问管理页面测试
访问zimbra管理页面,在浏览器输入:
https://192.168.0.233:7071

访问zimbra邮箱页面,在浏览器输入:
https://192.168.0.233:8443

修改位置截图
vim /etc/named.conf

vim /var/named/zimbra.com

vim /var/named/192.168.0.arpa

vim /etc/sysconfig/network-scripts/ifcfg-enp0s3

1. vim /etc/hosts

重启需要执行:(不然收不到邮件)
systemctl stop postfix.service
systemctl disable postfix.service
systemctl restart named.service

注意关闭防火墙:
systemctl disable firewalld
systemctl stop firewalld


参考地址:
http://www.cnblogs.com/k98091518/p/7053767.html
https://blog.csdn.net/wanglei_storage/article/details/50736371
https://www.cnblogs.com/qingfengfumian/p/7881599.html
https://blog.csdn.net/linuxnews/article/details/51106905


Zimbra在linux系统上的删除(卸载)方法
http://www.linuxyw.com/linux/qitafuwu/20130605/539.html
 类似资料: