Published on

Centos 7 安裝 Zimbra Open Source Email Platform

Authors
  • avatar
    Name
    Rick Jiang
    Twitter

記錄一下在 Centos 7 安裝 Zimbra Open Source Email Platform 的過程

DNS RECORD

TypeNameContentTTL
Amail.yourdomain.com34.81.70.25Auto
MXyourdomain.com10 mail.yourdomain.com.Auto
$ yum check-update
$ yum update -y

$ vi /etc/selinux/config
# SELINUX=disabled

# Sending email from an instance
# https://cloud.google.com/compute/docs/tutorials/sending-mail
# https://wiki.zimbra.com/wiki/Configuring_Zimbra_Using_Chef_Oracle_Cloud#Sendgrid_example
$ rm -rf /etc/dhcp/dhclient.d/google_hostname.sh
$ rm -rf /etc/dhcp/dhclient-exit-hooks.d/google_set_hostname

$ hostnamectl set-hostname mail.yourdomain.com
$ exec bash

$ vi /etc/hosts
  10.140.0.1 mail.yourdomain.com mail

$ cd /etc/sysconfig/network-scripts
$ ls
$ vi ifcfg-eth0
# DNS1=10.140.0.1
# DNS2=8.8.8.8
# DNS3=8.8.4.4
$ cd ~
$ systemctl restart network
$ systemctl restart NetworkManager.service

$ cat /etc/resolv.conf
# Generated by NetworkManager
# search yourdomain.com
# nameserver 10.140.0.1
# nameserver 8.8.8.8
# nameserver 8.8.4.4
$ reboot


$ yum install bind bind-utils -y
$ vi /etc/named.conf
# listen-on port 53 { 127.0.0.1; 10.140.0.1; }; : Add your server’s IP to this line
# allow-query     { localhost; 10.140.0.1; }; : Add your server’s IP to this line
# forwarders { 8.8.8.8; }; : Add this line at the end of the options block
# At last, add a zone (as shown below) for your domain (at the place as shown above).

# zone "yourdomain.com" {
#    type master;
#    file "yourdomain.com.zone";
#};
$ vi /var/named/yourdomain.com.zone
# ;
# ; BIND data file for local loopback interface
# ;

# $TTL    86400
# @       IN      SOA     ns1.yourdomain.com. root.yourdomain.com. (
#         2021051001 ; Serial
#         604800    ; Refresh
#         86400     ; Retry
#         2419200   ; Expire
#         604800 )  ; Negative Cache TTL

# ;
# ; name servers - NS records

# @       IN      NS      ns1.yourdomain.com.
# @               MX    10   mail.yourdomain.com.

# ; name servers - A records

# ns1    IN    A    10.140.0.1
# mail    IN    A    10.140.0.1
$ systemctl enable named && systemctl start named
$ dig -t A mail.yourdomain.com
$ dig -t MX yourdomain.com


$ systemctl stop postfix && systemctl disable postfix

$ yum install unzip net-tools sysstat openssh-clients perl-core libaio nmap-ncat libstdc++ wget -y

$ mkdir zimbra && cd zimbra
$ wget https://files.zimbra.com/downloads/8.8.15_GA/zcs-8.8.15_GA_3869.RHEL7_64.20190918004220.tgz
$ tar xvf zcs-8.8.15_GA_3869.RHEL7_64.20190918004220.tgz
$ cd  zcs-8.8.15_GA_3869.RHEL7_64.20190918004220
$ ./install.sh
# Install zimbra-dnscache [Y] N
# Install zimbra-drive [Y] N
# Install zimbra-imapd (BETA - for evaluation only) [N] N
# Install zimbra-chat [Y] N

# DNS ERROR resolving MX for mail.yourdomain.com
# It is suggested that the domain name have an MX record configured in DNS
# Change domain name? [Yes] yes
# Create domain: [mail.yourdomain.com] yourdomain.com
#         MX: mail.yourdomain.com (10.140.0.1)
#
#         Interface: 127.0.0.1
#         Interface: ::1
#         Interface: 10.140.0.1
# done.
# Checking for port conflicts

# Login Banner: 400 x 60 pixel (File Format PNG)
# Application Banner: 170 x 30 Pixel (File Format PNG)
$ mkdir /opt/zimbra/jetty/webapps/zimbra/logos/
$ chown zimbra:zimbra /opt/zimbra/jetty/webapps/zimbra/logos/MyLoginBanner.png
$ chown zimbra:zimbra /opt/zimbra/jetty/webapps/zimbra/logos/MyAppBanner.png
$ su zimbra
$ zmprov md yourdomain.com zimbraSkinLogoURL https://mail.yourdomain.com
$ zmprov md yourdomain.com zimbraSkinLogoLoginBanner /logos/MyLoginBanner.png
$ zmprov md yourdomain.com zimbraSkinLogoAppBanner /logos/MyAppBanner.png
$ zmcontrol restart
$ zmcontrol status

$ yum install firewalld
$ systemctl start firewalld
$ systemctl enable firewalld
$ firewall-cmd --permanent --add-port={25,80,110,143,443,465,587,993,995,5222,5223,9071,7071}/tcp
$ firewall-cmd --reload
$ firewall-cmd --list-all