Ещё один блог о системном администрировании, операционных системах, СУБД, сетях, костылях-велосипедах и пр.
Zimbra Collaboration Suite - программный продукт, аналог MS Exchange, предоставляющий собой не только электронную почту корпоративного уровня, но и календарь, и средство совместной работы, одинаково подходящий как крупным компаниям, так и небольшим фирмам. Включает в себя ряд бесплатных и открытых продуктов (Nginx, Apache, MySQL, Postfix и др.), имеет очень удобный web-интерфейс. Существуют как платные так и бесплатные версии ZCS. В этой заметке я рассмотрю установку бесплатной Open Source версии Zimbra на сервер под управлением СentOS 7.
Перед установкой следует правильно настроить разрешение имен на DNS сервере, мастер установки будет проверять A и MX и в случае неудачи завершит работу с ошибкой.
Также обязательно необходимо установить правильный hostname:
[root@mail ~]# hostnamectl set-hostname mail.example.com
[root@mail ~]# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localhost localhost.localdomain
10.1.200.5 mail.example.com
Отключим SELinux:
[root@mail ~]# nano /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
\*\*SELINUX=disabled\*\*
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
Остановим и удалим из автозапуска все MTA, установленные на сервере:
[root@mail ~]# systemctl stop postfix
[root@mail ~]# systemctl disable postfix
[root@mail ~]# systemctl stop sendmail
[root@mail ~]# systemctl disable sendmail
Не забываем про обновление операционной системы:
[root@mail ~]# yum update -y
Устанавливаем необходимые пакеты:
[root@mail ~]# yum install perl perl-core ntpl nmap sudo libidn gmp libaio libstdc++ unzip sysstat sqlite wget
Скачаем архив с установочными файлами Zimbra:
[root@mail ~]# wget https://files.zimbra.com/downloads/8.7.0_GA/zcs-8.7.0_GA_1659.RHEL7_64.20160628202714.tgz
Разархивируем его и перейдем в полученный каталог:
[root@mail ~]# tar -xzf zcs-8.7.0_GA_1659.RHEL7_64.20160628202714.tgz
[root@mail ~]# cd zcs-8.7.0_GA_1659.RHEL7_64.20160628202714
Запускаем процесс установки следующей командой:
[root@mail zcs-8.7.0_GA_1659.RHEL7_64.20160628202714]# ./install.sh --platform-override
Ниже представлена простыня, в которой показана работа install-скрипта с вопросами и ответами:
[root@mail zcs-8.7.0_GA_1659.RHEL7_64.20160628202714]# ./install.sh --platform-override
Operations logged to /tmp/install.log.XtF7xszB
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] 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
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/security/limits.conf...done.
Finished removing Zimbra Collaboration Server.
Installing packages
Local packages zimbra-core zimbra-ldap zimbra-logger zimbra-mta zimbra-snmp zimbra-store zimbra-apache zimbra-spell zimbra-proxy selected for installation
Monitor /tmp/install.log.XtF7xszB for package installation progress
Remote package installation started
Installing zimbra-core-components zimbra-ldap-components zimbra-mta-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-snmp zimbra-store zimbra-apache zimbra-spell zimbra-proxy...done
Operations logged to /tmp/zmsetup.20160721-144706.log
Installing LDAP configuration database...done.
Setting defaults...No results returned for A lookup of mail.example.com
Checked nameservers:
10.10.12.2
No results returned for AAAA lookup of mail.example.com
Checked nameservers:
10.10.12.2
DNS ERROR resolving mail.example.com
It is suggested that the hostname be resolvable via DNS
Change hostname [Yes] No
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] No
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@mail.example.com
******* +Admin Password UNSET
+Anti-virus quarantine user: virus-quarantine.2hwbbw7msh@mail.example.com
+Enable automated spam training: yes
+Spam training user: spam.jedk1fhggz@mail.example.com
+Non-spam(Ham) training user: ham.y4nb2o4bt@mail.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@mail.example.com
+Version update source email: admin@mail.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@mail.example.com
** 4) Admin Password UNSET
5) Anti-virus quarantine user: virus-quarantine.2hwbbw7msh@mail.example.com
6) Enable automated spam training: yes
7) Spam training user: spam.jedk1fhggz@mail.example.com
8) Non-spam(Ham) training user: ham.y4nb2o4bt@mail.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@mail.example.com
22) Version update source email: admin@mail.example.com
23) Install mailstore (service webapp): yes
24) Install UI (zimbra,zimbraAdmin webapps): yes
Select, or 'r' for previous menu [r] 3
Create admin user: [admin@mail.example.com ] admin@example.com
Password for admin@example.com (min 6 characters): [OVJAfSH4V] y0ur5tr0n9pa55w0rd
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.2hwbbw7msh@mail.example.com
6) Enable automated spam training: yes
7) Spam training user: spam.jedk1fhggz@mail.example.com
8) Non-spam(Ham) training user: ham.y4nb2o4bt@mail.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@mail.example.com
22) Version update source email: admin@mail.example.com
23) Install mailstore (service webapp): yes
24) Install UI (zimbra,zimbraAdmin webapps): yes
Select, or 'r' for previous menu [r] 21
Version update destination address: [admin@mail.example.com ] admin@example.com
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.2hwbbw7msh@mail.example.com
6) Enable automated spam training: yes
7) Spam training user: spam.jedk1fhggz@mail.example.com
8) Non-spam(Ham) training user: ham.y4nb2o4bt@mail.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@mail.example.com
23) Install mailstore (service webapp): yes
24) Install UI (zimbra,zimbraAdmin webapps): yes
Select, or 'r' for previous menu [r] 22
Version update source address: [admin@mail.example.com ] admin@example.com
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.2hwbbw7msh@mail.example.com
6) Enable automated spam training: yes
7) Spam training user: spam.jedk1fhggz@mail.example.com
8) Non-spam(Ham) training user: ham.y4nb2o4bt@mail.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.6974]
Saving config in /opt/zimbra/config.6974...done.
The system will be modified - continue? [No] Yes
Operations logged to /tmp/zmsetup.20160721-144706.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
Setting TimeZone Preference...done.
Initializing mta config...done.
Setting services on mail.example.com ...done.
Adding mail.example.com to zimbraMailHostPool in default COS...done.
Creating domain mail.example.com ...done.
Setting default domain name...done.
Creating domain example.com ...done.
Creating admin account admin@example.com ...done.
Creating root alias...done.
Creating postmaster alias...done.
Creating user spam.jedk1fhggz@mail.example.com ...done.
Creating user ham.y4nb2o4bt@mail.example.com ...done.
Creating user virus-quarantine.2hwbbw7msh@mail.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...done.
Installing common zimlets...
com_zimbra_cert_manager...done.
com_zimbra_ymemoticons...done.
com_zimbra_adminversioncheck...done.
com_zimbra_tooltip...done.
com_zimbra_mailarchive...done.
com_zimbra_viewmail...done.
com_zimbra_date...done.
com_zimbra_url...done.
com_zimbra_email...done.
com_zimbra_webex...done.
com_zimbra_attachcontacts...done.
com_zimbra_bulkprovision...done.
com_zimbra_srchhighlighter...done.
com_zimbra_proxy_config...done.
com_zimbra_attachmail...done.
com_zimbra_clientuploader...done.
com_zimbra_phone...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.0_GA_1659_RHEL7_64)
The ADMIN EMAIL ADDRESS created (admin@example.com )
Notify Zimbra of your installation? [Yes] No
Notification skipped
Setting up zimbra crontab...done.
Moving /tmp/zmsetup.20160721-144706.log to /opt/zimbra/log
Configuration complete - press return to exit
После того, как разрешим все необходимые порты в файерволе, запустим сервер:
[root@mail zcs-8.7.0_GA_1659.RHEL7_64.20160628202714]# su - zimbra
[zimbra@mail ~]$ zmcontrol start
Host mail.example.com
Starting zmconfigd...Done.
Starting logger...Done.
Starting mailbox...Done.
Starting memcached...Done.
Starting proxy...Done.
Starting amavis...Done.
Starting antispam...Done.
Starting antivirus...Done.
Starting opendkim...Done.
Starting snmp...Done.
Starting spell...Done.
Starting mta...Done.
Starting stats...Done.
Starting service webapp...Done.
Starting zimbra webapp...Done.
Starting zimbraAdmin webapp...Done.
Starting zimlet webapp...Done.
[zimbra@mail ~]$
Перейдем теперь в админ-панель нашего почтового сервера, набрав в адресной строке браузера:
https://mail.example.com:7071
При первом входе браузер не пустит на страницу и покажет это:
Оно и понятно - здесь используется самоподписанный сертификат, которому браузер не может доверять, так как нет доверия к выпустившему его центру сертификации. Можно, конечно, данное предупреждение игнорировать, но, кроме неудобства, это приучает пользователей легкомысленно отностится к подобным предупреждениям, что таит потенциальную угрозу безопасности. Но мы, в отличие от браузера, знаем, кто выпустил данный сертификат и доверяем этому центру. Чтобы браузер также начал доверять сертификатам данного центра сертификации нам нужно экпортировать корневой сертификат Zimbra и установить его в систему.
Выполняем экспорт сертификата Zimbra:
[root@mail ~]# cd /opt/zimbra/ssl/zimbra/ca
[root@mail ~]# openssl x509 -in ca.pem -outform DER -out ~/zimbra-mail-example.cer
После скачаем этот сертификат, можно воспользоваться программой WinSCP. Устанавливаем при помощи групповой политики данный сертификат на все пользовательские машины в домене, конечно же, если у вас есть домен. Если домена нет - вручную устанавливаем на каждом компьютере.
Снова попробуем войти в админ-панель:
По умолчанию веб-интерфейс почтового сервера Zimbra настроен для доступа только по защищенному протоколу HTTPS. Это безопасно, но не совсем удобно для пользователя, так как ему нужно каждый раз набирать адрес полностью, c https://, а с учетом того, что все пользуются закладками, то это быстро забывается и при попытке получить доступ с нового клиентского устройства пользователь столкнется с недоступностью сервиса.
Изменение протоколов доступа к веб-интерфейсу производится через командную строку. Необходимо зайти под поьзователем zimbra:
[root@mail ~]# su - zimbra
Для изменения режима доступа к веб-интерфейсу служит команда:
[zimbra@mail ~]$ zmtlsctl [mode]
где mode - тип необходимого режима доступа. Реньше режимов было 5 - http, https, both, mixed, redirect. В Zimbra 8.7.0 их осталось только 3 - http, https, both. Рассмотрим их подробнее:
Выбираем необходимый режим и перезапускаем службы почтового сервера:
[zimbra@mail ~]$ zmtlsctl both
[zimbra@mail ~]$ zmcontrol restart
Таким образом получилось значительно повысить удобство работы пользователей практически без ущерба для безопасности.
Если во время установки что-то пошло не так, то Zimbra можно удалить с помощью того же установочного скрипта:
[root@mail zcs-8.7.0_GA_1659.RHEL7_64.20160628202714]# ./install.sh -u
Если почтовый сервер Zimbra находится за NAT, и вдруг поняли, что на почтовые ящики не приходят письма, и в лог-файле /var/log/zimbra.log наблюдаются примерно следующее:
postfix/lmtp ... deferred ... connection refused
то необходимо выполнить:
[root@mail ~]# su - zimbra
[root@mail ~]# zmprov ms mail.example.com zimbraMtaLmtpHostLookup native
[root@mail ~]# zmcontrol restart
Комментарии (RSS)
Спасибо за статью! Все понятно написано. Установка оказалась не такой уж и сложной)
А, что очень даже интересно,спасибо за информацию.