1.1 基础环境配置
1.1.1 主机名配置
[root@mail ~]# hostnamectl --static set-hostname mail.example.com [root@mail ~]# hostname mail.example.com
1.1.2 hosts解析配置
[root@mail ~]# echo "192.168.x.x mail.example.com mail" >> /etc/hosts [root@mail ~]# cat /etc/hosts | tail -1 192.168.x.x mail.example.com mail
1.1.3 iptables配置
[root@mail ~]# iptables -A INPUT -p tcp -m multiport --dport 80,443,25,110,143,465,389,995,993,587,7025,8443,7071 -j ACCEPT
1.2 安装配置bind
1.2.1 安装bind
[root@mail ~]# yum install bind bind-utils -y
1.2.2 启动named服务并设置随开机启动
[root@mail ~]# systemctl enable named
[root@mail ~]# systemctl start named
1.2.3 修改/etc/named.conf主配置文件
[root@mail ~]# vim /etc/named.conf attacks. Implementing BCP38 within your network would greatly // // named.conf // // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS // server as a caching only nameserver (as a localhost DNS resolver only). // // See /usr/share/doc/bind*/sample/ for example named configuration files. // // See the BIND Administrator's Reference Manual (ARM) for details about the // configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html options { listen-on port 53 { 127.0.0.1;192.168.x.0/24; }; 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"; recursing-file "/var/named/data/named.recursing"; secroots-file "/var/named/data/named.secroots"; allow-query { localhost;192.168.x.0/24; }; /* - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion. - If you are building a RECURSIVE (caching) DNS server, you need to enable recursion. - If your recursive DNS server has a public IP address, you MUST enable access control to limit queries to your legitimate users. Failing to do so will cause your server to become part of large scale DNS amplification attacks. Implementing BCP38 within your network would greatly reduce such attack surface */ 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"; pid-file "/run/named/named.pid"; session-keyfile "/run/named/session.key"; }; logging { channel default_debug { file "data/named.run"; severity dynamic; }; }; zone "." IN { type hint; file "named.ca"; }; include "/etc/named.rfc1912.zones"; include "/etc/named.root.key"; include "/etc/named.example.zones";
1.2.4 创建/etc/named.example.zones区域配置文件
[root@mail ~]# vim /etc/named.example.zones //erp.com.zone Domain resolve IP zone "example.com" IN { type master; file "example.com.zone"; }; //x.168.192.zone IP resolve Domain zone "x.168.192.in-addr.arpa" IN { type master; file "x.168.192.zone"; };
1.2.5 创建正向解析配置文件/var/named/example.com.zone
[root@mail ~]# vim /var/named/example.com.zone $TTL 1D @ IN SOA @ example.com. ( 20190607 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; minimum NS ns1.example.com. IN MX 10 mail A 127.0.0.1 AAAA ::1 ns1 IN A 192.168.x.x dns01 IN CNAME ns1 mail IN A 192.168.x.x
1.2.6 创建反向解析配置文件/var/named/x.168.192.zone
[root@mail ~]# vim /var/named/x.168.192.zone $TTL 1D @ IN SOA @ ns1.example.com. ( 20190607 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; minimum NS ns1.example.com. A 127.0.0.1 AAAA ::1 PTR localhost. x PTR ns1
1.2.7 更改配置文件相应的权限
[root@mail ~]# chown :named /etc/named.example.zones [root@mail ~]# chown :named /var/named/example.com.zone [root@mail ~]# chown :named /var/named/11.168.192.zone
1.2.8 检查named配置文件语法是否正常
[root@mail ~]# named-checkconf [root@mail ~]# named-checkzone "example.com" /var/named/example.com.zone zone example.com/IN: loaded serial 20190607 OK [root@mail ~]# named-checkzone "x.168.192.in-addr.arpa" /var/named/x.168.192.zone zone 11.168.192.in-addr.arpa/IN: loaded serial 20190607 OK
1.2.9 验证测试MX记录
[root@mail ~]# dig MX example.com ; <<>> DiG 9.9.4-RedHat-9.9.4-73.el7_6 <<>> MX example.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11248 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 3 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;example.com. IN MX ;; ANSWER SECTION: example.com. 86400 IN MX 10 mail.example.com. ;; AUTHORITY SECTION: example.com. 86400 IN NS ns1.example.com. ;; ADDITIONAL SECTION: mail.example.com. 86400 IN A 192.168.x.x ns1.example.com. 86400 IN A 192.168.x.x ;; Query time: 0 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Tue Jun 11 16:53:11 CST 2019 ;; MSG SIZE rcvd: 112
1.3 安装配置zimbra
1.3.1 将下载好的zimbra上传至服务器,解压并改名
[root@mail opt]# tar zxvf zcs-8.8.12_GA_3794.RHEL7_64.20190329045002.tgz [root@mail opt]# mv zcs-8.8.12_GA_3794.RHEL7_64.20190329045002 zimbra
1.3.2 执行安装脚本./install.sh
[root@mail opt]# cd zimbra/ [root@mail zimbra]# ls bin docs lib readme_binary_en_US.txt util data install.sh packages README.txt [root@mail zimbra]# ./install.sh Operations logged to /tmp/install.log.DG9ri16l Checking for existing installation... zimbra-drive...NOT FOUND zimbra-imapd...NOT FOUND zimbra-patch...NOT FOUND zimbra-mta-patch...NOT FOUND zimbra-proxy-patch...NOT FOUND zimbra-license-tools...NOT FOUND zimbra-license-extension...NOT FOUND zimbra-network-store...NOT FOUND zimbra-network-modules-ng...NOT FOUND zimbra-chat...NOT FOUND zimbra-talk...NOT FOUND 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 Use Zimbra's package repository [Y] y Configuring package repository Checking for installable packages Found zimbra-core (local) Found zimbra-ldap (local) Found zimbra-logger (local) Found zimbra-mta (local) Found zimbra-dnscache (local) Found zimbra-snmp (local) Found zimbra-store (local) Found zimbra-apache (local) Found zimbra-spell (local) Found zimbra-memcached (repo) Found zimbra-proxy (local) Found zimbra-drive (repo) Found zimbra-imapd (local) Found zimbra-patch (repo) Found zimbra-mta-patch (repo) Found zimbra-proxy-patch (repo) The Zimbra Collaboration Server does not appear to be installed, yet there appears to be a ZCS directory structure in /opt/zimbra. Would you like to delete /opt/zimbra before installing? [N] n 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 Install zimbra-drive [Y] y Install zimbra-imapd (BETA - for evaluation only) [N] n Install zimbra-chat [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 zimbra-drive zimbra-patch zimbra-mta-patch zimbra-proxy-patch zimbra-chat The system will be modified. Continue? [N] y Beginning Installation - see /tmp/install.log.DG9ri16l for details... zimbra-core-components will be downloaded and installed. zimbra-timezone-data will be installed. zimbra-common-core-jar will be installed. zimbra-common-mbox-conf will be installed. zimbra-common-mbox-conf-attrs will be installed. zimbra-common-mbox-conf-msgs will be installed. zimbra-common-mbox-conf-rights will be installed. zimbra-common-mbox-db will be installed. zimbra-common-mbox-docs will be installed. zimbra-common-mbox-native-lib will be installed. zimbra-common-core-libs will be installed. zimbra-core will be installed. zimbra-ldap-components will be downloaded and installed. zimbra-ldap will be installed. zimbra-logger will be installed. zimbra-mta-components will be downloaded and installed. zimbra-mta will be installed. zimbra-snmp-components will be downloaded and installed. zimbra-snmp will be installed. zimbra-store-components will be downloaded and installed. zimbra-jetty-distribution will be downloaded and installed. zimbra-mbox-conf will be installed. zimbra-mbox-war will be installed. zimbra-mbox-service will be installed. zimbra-mbox-webclient-war will be installed. zimbra-mbox-admin-console-war will be installed. zimbra-mbox-store-libs will be installed. zimbra-store will be installed. zimbra-apache-components will be downloaded and installed. zimbra-apache will be installed. zimbra-spell-components will be downloaded and installed. zimbra-spell will be installed. zimbra-memcached will be downloaded and installed. zimbra-proxy-components will be downloaded and installed. zimbra-proxy will be installed. zimbra-drive will be downloaded and installed (later). zimbra-patch will be downloaded and installed (later). zimbra-mta-patch will be downloaded and installed. zimbra-proxy-patch will be downloaded and installed (later). zimbra-chat will be downloaded and installed (later). Downloading packages (11): zimbra-core-components zimbra-ldap-components zimbra-mta-components zimbra-snmp-components zimbra-store-components zimbra-jetty-distribution zimbra-apache-components zimbra-spell-components zimbra-memcached zimbra-proxy-components zimbra-mta-patch ...done Shutting down zimbra mail Removing existing packages Installing repo packages (11): zimbra-core-components zimbra-ldap-components zimbra-mta-components zimbra-snmp-components zimbra-store-components zimbra-jetty-distribution zimbra-apache-components zimbra-spell-components zimbra-memcached zimbra-proxy-components zimbra-mta-patch ...done Installing local packages (25): zimbra-timezone-data zimbra-common-core-jar zimbra-common-mbox-conf zimbra-common-mbox-conf-attrs zimbra-common-mbox-conf-msgs zimbra-common-mbox-conf-rights zimbra-common-mbox-db zimbra-common-mbox-docs zimbra-common-mbox-native-lib zimbra-common-core-libs zimbra-core zimbra-ldap zimbra-logger zimbra-mta zimbra-snmp zimbra-mbox-conf zimbra-mbox-war zimbra-mbox-service zimbra-mbox-webclient-war zimbra-mbox-admin-console-war zimbra-mbox-store-libs zimbra-store zimbra-apache zimbra-spell zimbra-proxy ...done Installing extra packages (4): zimbra-drive zimbra-patch zimbra-proxy-patch zimbra-chat ...done Running Post Installation Configuration: Operations logged to /tmp/zmsetup.20190611-120141.log Installing LDAP configuration database...done. Setting defaults... DNS ERROR resolving MX for mail.example.com It is suggested that the domain name have an MX record configured in DNS Change domain name? [Yes] example.com A Yes/No answer is required Change domain name? [Yes] yes Create domain: [mail.example.com] example.com MX: mail.example.com (192.168.x.x) Interface: 127.0.0.1 Interface: 192.168.x.x 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@example.com ******* +Admin Password UNSET +Anti-virus quarantine user: virus-quarantine.txasp5uiov@example.com +Enable automated spam training: yes +Spam training user: spam.mjfuifkft@example.com +Non-spam(Ham) training user: ham.uprlqdwkf0@example.com +SMTP host: mail.example.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.example.com:7780/aspell.php +Enable version update checks: TRUE +Enable version update notifications: TRUE +Version update notification email: admin@example.com +Version update source email: admin@example.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@example.com ** 4) Admin Password UNSET 5) Anti-virus quarantine user: virus-quarantine.txasp5uiov@example.com 6) Enable automated spam training: yes 7) Spam training user: spam.mjfuifkft@example.com 8) Non-spam(Ham) training user: ham.uprlqdwkf0@example.com 9) SMTP host: mail.example.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.example.com:7780/aspell.php 19) Enable version update checks: TRUE 20) Enable version update notifications: TRUE 21) Version update notification email: admin@example.com 22) Version update source email: admin@example.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@example.com (min 6 characters): [wB7cQ5qdt] amar_s0ft. Store configuration 1) Status: Enabled 2) Create Admin User: yes 3) Admin user to create: admin@example.com 4) Admin Password set 5) Anti-virus quarantine user: virus-quarantine.txasp5uiov@example.com 6) Enable automated spam training: yes 7) Spam training user: spam.mjfuifkft@example.com 8) Non-spam(Ham) training user: ham.uprlqdwkf0@example.com 9) SMTP host: mail.example.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.example.com:7780/aspell.php 19) Enable version update checks: TRUE 20) Enable version update notifications: TRUE 21) Version update notification email: admin@example.com 22) Version update source email: admin@example.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] yes Save config in file: [/opt/zimbra/config.718] Saving config in /opt/zimbra/config.718...done. The system will be modified - continue? [No] yes Operations logged to /tmp/zmsetup.20190611-120141.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.example.com...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.example.com...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.example.com to zimbraReverseProxyAvailableLookupTargets Updating zimbraLDAPSchemaVersion to version '1537783098' Setting TimeZone Preference...done. Disabling strict server name enforcement on mail.example.com...done. Initializing mta config...done. Setting services on mail.example.com...done. Adding mail.example.com to zimbraMailHostPool in default COS...done. Creating domain example.com...done. Setting default domain name...done. Creating domain example.com...already exists. Creating admin account admin@example.com...done. Creating root alias...done. Creating postmaster alias...done. Creating user spam.mjfuifkft@example.com...done. Creating user ham.uprlqdwkf0@example.com...done. Creating user virus-quarantine.txasp5uiov@example.com...done. Setting spam training and Anti-virus quarantine accounts...done. Initializing store sql database...done. Setting zimbraSmtpHostname for mail.example.com...done. Configuring SNMP...done. Setting up syslog.conf...done. Starting servers...Search error: Unable to determine enabled services from ldap. Enabled services read from cache. Service list may be inaccurate. done. Installing common zimlets... com_zimbra_adminversioncheck...failed. This may impact system functionality. com_zimbra_attachcontacts...failed. This may impact system functionality. com_zimbra_attachmail...failed. This may impact system functionality. com_zimbra_bulkprovision...failed. This may impact system functionality. com_zimbra_cert_manager...failed. This may impact system functionality. com_zimbra_clientuploader...failed. This may impact system functionality. com_zimbra_date...failed. This may impact system functionality. com_zimbra_email...failed. This may impact system functionality. com_zimbra_mailarchive...failed. This may impact system functionality. com_zimbra_phone...failed. This may impact system functionality. com_zimbra_proxy_config...failed. This may impact system functionality. com_zimbra_srchhighlighter...failed. This may impact system functionality. com_zimbra_tooltip...failed. This may impact system functionality. com_zimbra_url...failed. This may impact system functionality. com_zimbra_viewmail...failed. This may impact system functionality. com_zimbra_webex...failed. This may impact system functionality. com_zimbra_ymemoticons...failed. This may impact system functionality. com_zextras_drive_open...failed. This may impact system functionality. com_zextras_chat_open...failed. This may impact system functionality. Finished installing common zimlets. Restarting mailboxd...done. Creating galsync account for default domain...failed. 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.8.12_GA_3794_RHEL7_64) The ADMIN EMAIL ADDRESS created (admin@example.com) Notify Zimbra of your installation? [Yes] yes Notifying Zimbra of installation via http://www.zimbra.com/cgi-bin/notify.cgi?VER=8.8.12_GA_3794_RHEL7_64&MAIL=admin@example.com Notification complete Checking if the NG started running...done. Setting up zimbra crontab...done. Moving /tmp/zmsetup.20190611-120141.log to /opt/zimbra/log Configuration complete - press return to exit [root@mail zimbra]#
1.3.3 查看zimbra服务状态
[root@mail ~]# su - zimbra Last login: Tue Jun 11 15:19:39 CST 2019 on pts/1 [zimbra@mail ~]$ zmcontrol status Host mail.example.com 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 [zimbra@mail ~]$
1.3.4 客户端登录验证
1.3.4.1 管理员访问
1.3.4.2 普通用户访问
1.4 参考链接
1.4.1 相关文档
https://www.zimbra.com/documentation/ https://zimbra.github.io/installguides/latest/single.html#Installing_Zimbra_Collaboration_Software