如何在 CentOS 8 / RHEL 8 上安装 Zimbra 邮件服务器

[ad_1]

邮件服务器是任何组织的重要服务器之一,因为所有通信都是通过电子邮件完成的。 IT 世界中有免费和企业邮件服务器可用。 Zimbra 是开源和企业版中评价最高的邮件服务器之一。 在本文中,我们将接触如何在 CentOS 8 / RHEL 8 系统上安装和配置单节点开源 Zimbra 邮件服务器。

Zimbra 也被称为 Zimbra 协作套件 (ZCS) 因为它由许多组件组成,例如 MTA (后缀), 数据库 (MariaDB), LDAP邮箱界面 等等 下面是Zimbra的架构

开源 Zimbra 邮件服务器的最低系统要求

  • 最小 CentOS 8/ RHEL 8
  • 8 GB 内存
  • 64 位 Intel / AMD CPU (1.5 GHz)
  • 将分区作为 /opt 分离,至少有 5 GB 可用空间
  • 完全限定域名 (FQDN),如“zimbra.linuxtechi.com”
  • 具有固定内部/公共 IP 的稳定互联网连接

以下是我的 Zimbra 实验室设置详细信息:

  • 主机名:zimbra.linuxtechi.com
  • 域名:linuxtechi.com
  • IP 地址:192.168.1.60
  • DNS 服务器:192.168.1.51
  • SELinux:已启用
  • 防火墙:已启用

在进入 Zimbra 的安装步骤之前,让我们验证一下 Zimbra 服务器的 DNS 记录(A 和 MX),登录到您的 CentOS 8 / RHEL 8 系统并使用 dig 命令查询 dns 记录

笔记: 如果 dig 命令不可用,则安装 ‘绑定工具‘ 包裹

运行以下 dig 命令来查询我们 Zimbra 服务器的 A 记录

[[email protected] ~]# dig -t A zimbra.linuxtechi.com

运行以下 dig 命令以查询我们域的 MX 记录’linuxtechi.com

[[email protected] ~]# dig -t MX linuxtechi.com

以上输出确认我们的 Zimbra 邮件服务器的 DNS 记录配置正确。

另请阅读如何在 CentOS 8 / RHEL8 上设置 DNS 服务器(绑定)

笔记: 在开始安装 Zimbra 之前,请确保系统上没有配置 MTA(或邮件服务器)。 如果已安装,则首先禁用其服务并删除其软件包

# systemctl stop postfix
# dnf remove postfix -y

让我们深入了解 Zimbra 安装步骤,

步骤 1) 应用更新,在主机文件中添加条目并重新启动系统

在 hosts 文件中添加主机名条目,运行以下 echo 命令,

[[email protected] ~]# echo "192.168.1.60  zimbra.linuxtechi.com" >> /etc/hosts

运行下面的命令来应用所有可用的更新,

[[email protected] ~]# dnf update -y

安装完所有更新后,重新启动系统一次。

[[email protected] ~]# reboot

步骤 2) 下载开源 Zimbra 协作套件

正如我们上面讨论的,Zimbra 有两个版本,因此请使用以下 URL 下载

要从命令行下载它,请运行以下命令,

[[email protected] ~]# dnf install wget tar perl net-tools nmap-ncat -y
[[email protected] ~]# wget https://files.zimbra.com/downloads/8.8.15_GA/zcs-8.8.15_GA_3953.RHEL8_64.20200629025823.tgz

步骤 3) 通过安装脚本启动 Zimbra 安装

在步骤 2 中下载压缩的 Zimbra tar 文件后,使用以下命令将其解压缩到当前工作目录中 tar 命令,

[[email protected] ~]# tar zxpvf zcs-8.8.15_GA_3953.RHEL8_64.20200629025823.tgz
[[email protected] ~]# ls -l
total 251560
-rw-------. 1 root root      1352 Aug 30 10:46 anaconda-ks.cfg
drwxrwxr-x. 8 1001 1001      4096 Jun 29 11:39 zcs-8.8.15_GA_3953.RHEL8_64.20200629025823
-rw-r--r--. 1 root root 257588163 Jul  1 07:16 zcs-8.8.15_GA_3953.RHEL8_64.20200629025823.tgz
[[email protected] ~]#

进入解压目录并执行安装脚本开始安装

[[email protected] ~]# cd zcs-8.8.15_GA_3953.RHEL8_64.20200629025823
[[email protected] zcs-8.8.15_GA_3953.RHEL8_64.20200629025823]# ls -l
total 24
drwxrwxr-x. 2 1001 1001  127 Jun 29 11:39 bin
drwxrwxr-x. 2 1001 1001   31 Jun 29 11:39 data
drwxrwxr-x. 3 1001 1001   34 Jun 29 11:39 docs
-rwxr-xr-x. 1 1001 1001 8873 Jun 29 11:39 install.sh
drwxrwxr-x. 3 1001 1001   18 Jun 29 11:39 lib
drwxrwxr-x. 3 1001 1001 4096 Jun 29 11:39 packages
-rw-rw-r--. 1 1001 1001  369 Jun 29 11:39 readme_binary_en_US.txt
-rw-rw-r--. 1 1001 1001  428 Jun 29 11:39 README.txt
drwxrwxr-x. 3 1001 1001   76 Jun 29 11:39 util
[[email protected] zcs-8.8.15_GA_3953.RHEL8_64.20200629025823]# ./install.sh

安装脚本的输出如下所示

按 ‘‘ 接受许可协议

在下一个屏幕中,按 ‘‘ 配置 Zimbra 软件包存储库并安装其组件。

在接下来的屏幕中,按“‘ 修改系统,

一旦我们按下 ‘‘,它将开始下载和安装 Zimbra 及其组件。 安装成功后,我们会看到如下画面:

正如我们在上面看到的, admin 用户的密码没有设置,所以按 7 进而 4 将密码分配给 admin 用户。

设置密码后,按“r‘ 转到上一个屏幕,然后按 ‘一种‘ 应用更改。

完成所有配置并成功启动 Zimbra 服务后,我们将看到以下屏幕:

完美,以上确认我们已经成功安装Zimbra邮件服务器。 在访问它之前 admin 和 Web 客户端门户,在操作系统防火墙中允许以下端口(如果防火墙被禁用,则跳过此步骤)

[[email protected] ~]# firewall-cmd --add-service={http,https,smtp,smtps,imap,imaps,pop3,pop3s} --permanent
success
[[email protected] ~]# firewall-cmd --add-port 7071/tcp --permanent
success
[[email protected] ~]# firewall-cmd --add-port 8443/tcp --permanent
success
[[email protected] ~]# firewall-cmd --reload
success
[[email protected] ~]#

步骤 4) 访问 Zimbra 邮件服务器管理门户和 Web 客户端

要访问管理门户,请使用以下 URL:

https://zimbra.linuxtechi.com:7071/

使用用户名作为 ‘admin‘ 和我们在安装过程中设置的密码

点击 ‘登入

笔记: 在 CentOS 8 / RHEL 8 系统上安装 Zimbra 后,我发现 阿维斯 没有运行,当我检查 Zimbra 日志时(/var/log/zimbra.log) 然后我发现了以下错误:

Sep  5 09:53:05 zimbra amavis[29288]: Net::Server: Binding to TCP port 10024 on host 127.0.0.1 with IPv4
Sep  5 09:53:05 zimbra amavis[29288]: Net::Server: Binding to TCP port 10024 on host ::1 with IPv6
Sep  5 09:53:05 zimbra amavis[29288]: (!)Net::Server: 2020/09/05-09:53:05 Can't connect to TCP port 10024 on ::1 [Cannot assign requested address]n  at line 64 in file /opt/zimbra/common/lib/perl5/Net/Server/Proto/TCP.pm
Sep  5 09:53:05 zimbra amavis[29288]: Net::Server: 2020/09/05-09:53:05 Server closing!

我通过添加以下参数解决了 amavis 问题 /opt/zimbra/conf/amavisd.conf 文件

$inet_socket_bind = '127.0.0.1';

并使用以下命令重新启动 amavis 服务,

[[email protected] ~]$ zmamavisdctl restart

要访问 Web 客户端,请使用以下 URL:

https://zimbra.linuxtechi.com

输入凭据后,单击“登入

步骤 5)从命令行管理 Zimbra

大多数 Linux 极客更喜欢命令行来管理他们的服务器,所以 Zimbra 也可以从命令行管理 控制 公用事业。 所有 Zimbra 相关 admin 和操作任务由 Zimbra 用户执行。

[[email protected] ~]# su - zimbra
Last login: Sat Sep  5 09:51:41 BST 2020 on pts/1
[[email protected] ~]$ zmcontrol status
Host zimbra.linuxtechi.com
        amavis                  Running
        antispam                Running
        antivirus               Running
        dnscache                Running
        imapd                   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
[[email protected] ~]$

如果你想重启 Zimbra 服务然后运行,

[[email protected] ~]$ zmcontrol restart

Zimbra 日志存储在 ‘/var/log/zimbra.log‘ 文件。 在进行故障排除时,我们应该始终参考此文件。 各个组件的日志文件存储在“/选择/zimbra/log’ 目录。

[[email protected] ~]$ ls -l /opt/zimbra/log | more
total 6244
-rw-r-----. 1 zimbra zimbra  194710 Sep  5 12:40 access_log.2020-09-05
-rw-r-----. 1 zimbra zimbra       0 Sep  5 09:11 activity.log
-rw-r-----. 1 zimbra zimbra       6 Sep  5 09:58 amavis-mc.pid
-rw-r-----. 1 zimbra zimbra       6 Sep  5 09:58 amavisd.pid
-rw-r-----. 1 zimbra zimbra   16112 Sep  5 12:40 audit.log
-rw-r-----. 1 zimbra zimbra   10999 Sep  5 12:49 clamd.log
-rw-rw-r--. 1 zimbra zimbra       6 Sep  5 09:53 clamd.pid
-rw-r-----. 1 zimbra zimbra       0 Sep  5 09:11 ews.log
-rw-r-----. 1 zimbra zimbra    3427 Sep  5 11:54 freshclam.log
-rw-rw----. 1 zimbra zimbra       6 Sep  5 09:53 freshclam.pid
-rw-r-----. 1 root   root    553466 Sep  5 12:47 gc.log
-rw-r-----. 1 zimbra zimbra       6 Sep  5 09:54 httpd.pid
-rw-r-----. 1 zimbra zimbra    1241 Sep  5 09:54 httpd_error.log.2020-09-05
-rw-r-----. 1 zimbra zimbra       0 Sep  5 09:13 imapd-audit.log
-rw-r-----. 1 zimbra zimbra  247177 Sep  5 12:49 imapd.log
-rw-r-----. 1 zimbra zimbra     159 Sep  5 09:54 imapd.out
-rw-r-----. 1 zimbra zimbra       5 Sep  5 09:54 imapd.pid
-rw-r-----. 1 zimbra zimbra       6 Sep  5 09:51 logswatch.pid
-rw-r-----. 1 zimbra zimbra  584562 Sep  5 12:48 mailbox.log
-rw-r-----. 1 zimbra zimbra       6 Sep  5 09:51 memcached.pid
-rw-rw----. 1 zimbra zimbra   40340 Sep  5 12:48 myslow.log
-rw-rw----. 1 zimbra zimbra       6 Sep  5 09:51 mysql.pid
-rw-rw----. 1 zimbra zimbra   18266 Sep  5 09:51 mysql_error.log
-rw-r-----. 1 zimbra zimbra   20130 Sep  5 12:24 nginx.access.log
-rw-r-----. 1 zimbra zimbra   12652 Sep  5 12:24 nginx.log
-rw-r--r--. 1 root   root         6 Sep  5 09:51 nginx.pid
-rw-r-----. 1 zimbra zimbra       6 Sep  5 09:53 opendkim.pid
-rw-r-----. 1 zimbra zimbra       0 Sep  5 09:11 searchstat.log

步骤 6)卸载 Zimbra 服务器

出于任何原因,如果您希望从 CentOS 8 / RHEL 8 系统卸载 Zimbra 服务器,请转到 Zimbra 提取的文件夹并使用“-u”参数执行安装脚本,示例如下所示:

[[email protected] ~]# cd zcs-8.8.15_GA_3953.RHEL8_64.20200629025823
[[email protected] zcs-8.8.15_GA_3953.RHEL8_64.20200629025823]# ./install.sh -u

这就是本教程的全部内容,我希望您能够通过参考这些步骤在您的系统上安装开源 Zimbra 服务器。 请分享您的反馈和意见。

另请阅读CentOS 8 / RHEL 8 服务器的 7 大安全加固技巧

[ad_2]

Related Posts