Thẻ: Zimbra

Hướng dẫn cài đặt email zimbra 8.7 trên CentOS 7.x

Zimbra là một trong những ứng dụng mail mã nguồn mở miễn phí nổi tiếng, là một giải pháp hoàn chỉnh tổng thể để triển khai email server với nhiều tính năng và tiện ích, Zimbra đã được nhiều đơn vị lựa chọn là mã nguồn nền tảng để triển khai hệ thống email doanh nghiệp hoạt động ổn định tin cậy cao.

Dưới đây mình sẽ hướng dẫn các bạn triển khai xây dựng một hệ thống email server theo tên miền phục vụ cho doanh nghiệp nhỏ.

1- Cấu hình máy chủ VPS tối thiểu.

  • Ram: 2G
  • HDD: 200G
  • IP: 10.3.0.69
  • Domain: vnptdev.vn
  • Mail domain: mail.vnptdev.vn

2- Cài đặt

Bước 1: Chuẩn bị

2.1 – Disabled SELINUX

[root@mail ~]# vi /etc/sysconfig/selinux
SELINUX=disabled

2.2 – Tắt một số service mặc định trên server

[root@mail ~]# systemctl stop postfix
[root@mail ~]# systemctl disable postfix
[root@mail ~]# systemctl stop sendmail
[root@mail ~]# systemctl disable sendmail

2.3 – Install the required pacakages and libraries

[root@mail ~]# yum install perl perl-core ntpl nmap sudo libidn gmp libaio libstdc++ unzip sysstat sqlite -y

Bước 2: Thực hiện SSH vào máy chủ

2.4 – Đổi host name

# vi /etc/hosts

# hostnamectl set-hostname mail.vnptdev.vn

Sau khi thay đổi cần reboot lại server và kiểm tra lại kết quả khi server đã hoạt động trở lại.

2.5 – Tiếp theo, tạo 1 thư mục chứa file cài đặt và  tải bản cài đặt Zimbra về server

Link : https://www.zimbra.com/downloads/zimbra-collaboration-open-source/

Coppy link đường dẫn để tải bản cài đặt

[root@mail ~]# cd /opt
[root@mail ~]# mkdir zimbrainstall
[root@mail ~]# cd zimbrainstall
[root@mail ~]#  wget  https://files.zimbra.com/downloads/8.7.0_GA/zcs-8.7.0_GA_1659.RHEL7_64.20160628202714.tgz

2.6 – Giải nén file vừa tải về

[root@mail ~]# tar zxvf zcs-*.tgz

Di  chuyển vào thư mục vừa giải nén

[root@mail ~]# cd zcs-*

Chạy lệnh sau để bắt đầu cài đặt

[root@mail ~]# ./install.sh --platform-override

Khi tiến trình cài đặt bắt đầu, bạn sẽ cần phải chấp nhận các thỏa thuận cấp phép bằng cách nhấn Y ở mỗi hộp giấy phép. Khi bạn đến phần ‘Select packages to install’ bạn chỉ cần nhấn vào ở mỗi tùy chọn mà sẽ chọn các giá trị mặc định.

Operations logged to /tmp/install.log.xD4sSvlE
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-dnscache
    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.az92wdqk 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.20170523-121232.log
Installing LDAP configuration database...done.
Setting defaults...No results returned for A lookup of mail.vnptdev.vn
Checked nameservers:
 127.0.0.1
 ::1
No results returned for AAAA lookup of mail.vnptdev.vn
Checked nameservers:
 127.0.0.1
 ::1
DNS ERROR resolving mail.vnptdev.vn
It is suggested that the hostname be resolvable via DNS
Change hostname [Yes] Yes <<
Please enter the logical hostname for this host [mail.vnptdev.vn] vnptdev.vn <<
No results returned for A lookup of vnptdev.vn
Checked nameservers:
 127.0.0.1
 ::1
DNS ERROR resolving vnptdev.vn
It is suggested that the hostname be resolvable via DNS
Re-Enter hostname [Yes] No <<
DNS ERROR resolving MX for vnptdev.vn
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@vnptdev.vn 
******* +Admin Password UNSET 
 +Anti-virus quarantine user: virus-quarantine.fqvjakoiqk@vnptdev.vn
 +Enable automated spam training: yes 
 +Spam training user: spam.wdeuox8trw@vnptdev.vn 
 +Non-spam(Ham) training user: ham.jxmtaj4p@vnptdev.vn 
 +SMTP host: vnptdev.vn 
 +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://vnptdev.vn:7780/aspell.php
 +Enable version update checks: TRUE 
 +Enable version update notifications: TRUE 
 +Version update notification email: admin@mail.vnptdev.vn 
 +Version update source email: admin@mail.vnptdev.vn 
 +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@vnptdev.vn 
** 4) Admin Password UNSET 
 5) Anti-virus quarantine user: virus-quarantine.fqvjakoiqk@vnptdev.vn
 6) Enable automated spam training: yes 
 7) Spam training user: spam.wdeuox8trw@vnptdev.vn 
 8) Non-spam(Ham) training user: ham.jxmtaj4p@vnptdev.vn 
 9) SMTP host: vnptdev.vn 
 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://vnptdev.vn:7780/aspell.php
 19) Enable version update checks: TRUE 
 20) Enable version update notifications: TRUE 
 21) Version update notification email: admin@mail.vnptdev.vn 
 22) Version update source email: admin@mail.vnptdev.vn 
 23) Install mailstore (service webapp): yes 
 24) Install UI (zimbra,zimbraAdmin webapps): yes 
Select, or 'r' for previous menu [r] 4 <<
Password for admin@vnptdev.vn (min 6 characters): [BQEqtyqzV] vivas@123 <<
Store configuration
 1) Status: Enabled 
 2) Create Admin User: yes 
 3) Admin user to create: admin@vnptdev.vn 
 4) Admin Password set 
 5) Anti-virus quarantine user: virus-quarantine.fqvjakoiqk@vnptdev.vn
 6) Enable automated spam training: yes 
 7) Spam training user: spam.wdeuox8trw@vnptdev.vn 
 8) Non-spam(Ham) training user: ham.jxmtaj4p@vnptdev.vn 
 9) SMTP host: vnptdev.vn 
 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://vnptdev.vn:7780/aspell.php
 19) Enable version update checks: TRUE 
 20) Enable version update notifications: TRUE 
 21) Version update notification email: admin@mail.vnptdev.vn 
 22) Version update source email: admin@mail.vnptdev.vn 
 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.7046] 
Saving config in /opt/zimbra/config.7046...done.
The system will be modified - continue? [No] Yes <<
Operations logged to /tmp/zmsetup.20170523-130202.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.vnptdev.vn...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.vnptdev.vn...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.vnptdev.vn to zimbraReverseProxyAvailableLookupTargets
Setting Master DNS IP address(es)...done.
Setting DNS cache tcp lookup preference...done.
Setting DNS cache udp lookup preference...done.
Setting DNS tcp upstream preference...done.
Setting TimeZone Preference...done.
Initializing mta config...done.
Setting services on mail.vnptdev.vn...done.
Adding mail.vnptdev.vn to zimbraMailHostPool in default COS...done.
Creating domain vnptdev.vn...done.
Setting default domain name...done.
Creating domain vnptdev.vn...already exists.
Creating admin account admin@vnptdev.vn...done.
Creating root alias...done.
Creating postmaster alias...done.
Creating user spam.75f97glfl_@vnptdev.vn...done.
Creating user ham.1wvefhwye@vnptdev.vn...done.
Creating user virus-quarantine.rcmkdyvncg@vnptdev.vn...done.
Setting spam training and Anti-virus quarantine accounts...done.
Initializing store sql database...done.
Setting zimbraSmtpHostname for mail.vnptdev.vn...done.
Configuring SNMP...done.
Setting up syslog.conf...done.
Starting servers...done.
Installing common zimlets...
com_zimbra_phone...done.
com_zimbra_proxy_config...done.
com_zimbra_date...done.
com_zimbra_bulkprovision...done.
com_zimbra_email...done.
com_zimbra_url...done.
com_zimbra_attachcontacts...done.
com_zimbra_ymemoticons...done.
com_zimbra_srchhighlighter...done.
com_zimbra_cert_manager...done.
com_zimbra_attachmail...done.
com_zimbra_adminversioncheck...done.
com_zimbra_mailarchive...done.
com_zimbra_webex...done.
com_zimbra_tooltip...done.
com_zimbra_viewmail...done.
com_zimbra_clientuploader...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@vnptdev.vn)
Notify Zimbra of your installation? [Yes] Yes <<
Notifying Zimbra of installation via http://www.zimbra.com/cgi-bin/notify.cgi?VER=8.7.0_GA_1659_RHEL7_64&MAIL=admin@vnptdev.vn
Notification complete
Setting up zimbra crontab...done.
Moving /tmp/zmsetup.20170523-130202.log to /opt/zimbra/log
Configuration complete - press return to exit 

Như vậy hoàn thành bước cài đặt cơ bản cho email zimbra trên 1 server.

Bước 3: Cấu hình mở port trên firewall

[root@mail ~]# firewall-cmd --permanent --add-port=161/udp
[root@mail ~]# firewall-cmd --permanent --add-port=25/tcp
[root@mail ~]# firewall-cmd --permanent --add-port=2220/tcp
[root@mail ~]# firewall-cmd --permanent --add-port=80/tcp
[root@mail ~]# firewall-cmd --permanent --add-port=110/tcp
[root@mail ~]# firewall-cmd --permanent --add-port=143/tcp
[root@mail ~]# firewall-cmd --permanent --add-port=389/tcp
[root@mail ~]# firewall-cmd --permanent --add-port=443/tcp
[root@mail ~]# firewall-cmd --permanent --add-port=587/tcp
[root@mail ~]# firewall-cmd --permanent --add-port=465/tcp
[root@mail ~]# firewall-cmd --permanent --add-port=993/tcp
[root@mail ~]# firewall-cmd --permanent --add-port=995/tcp
[root@mail ~]# firewall-cmd --permanent --add-port=7071/tcp
[root@mail ~]# firewall-cmd --permanent --add-port=7780/tcp

Muôn xem ý nghĩa của các port các bạn có thể truy cập : https://wiki.zimbra.com/wiki/Firewall_Configuration

Khởi động lại Firewall để có hiệu lực.

[root@mail ~]# firewall-cmd --reload

Bước 4: kiểm tra lại status zimbra

[zimbra@mail ~]$ zmcontrol status
Host mail.vnptdev.vn
 amavis Running
 antispam Running
 antivirus Running
 dnscache Stopped
 dnscache is not 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

Bước 5: Truy nhập webmail trang quản trị theo đường dẫn theo dạng https://mail.tên-miền-của-bạn:7071

Đăng nhập bằng tài khoản admin; và mật khẩu đã tạo ở bước trên

Như vậy là bạn đã cài đặt thành công email zimbra 8.7 trên hệ điều hành CentOS 7.

Chúc bạn thực hiện thành công !

 

Advertisements