Home LinuxMail Server Hướng dẫn cài đặt Zimbra cơ bản trên CentOS 7

Hướng dẫn cài đặt Zimbra cơ bản trên CentOS 7

by Quốc Cường
93 views

Zimbra là một phần mềm triển khai dịch vụ Mail điện tử dạng client – server. Bài viết này hướng dẫn các bạn cách cài đặt Zimbra trên CentOS 7.

Thiết lập bản ghi DNS

Trỏ 1 bản ghi A và MX cho tên miền của bạn, thay mail.systuts.net bằng mail.tenmiencuaban.com

# Name Type Value TTL Prority
1 mail A 192.168.0.108 Auto 0
2 @ MX mail.systuts.net Auto 10

Chuẩn bị môi trường

  • CPU: 2 – 4 core
  • RAM: 8GB
  • SSD: 40GB
  • OS: CentOS 7

Cài đặt các package cần thiết

yum update -y
yum install perl epel-release -y

Cài đặt Zimbra Server

Stop postfix

systemctl stop postfix
systemctl disable postfix

Chỉnh sửa hostname

Thiết lập hostname bằng mail.tenmiencuaban.com, vd: mail.systuts.net

hostnamectl set-hostname mail.systuts.net
reboot

Chỉnh sửa file /etc/hosts

vi /etc/hosts

Thêm vào cuối dòng giá trị sau, chú ý thay mail.systuts.net bằng hostname của bạn và 192.168.0.108 bằng địa chỉ Ipv4 public của bạn.

192.168.0.108 mail.systuts.net mail

Download Zimbra Open Source

Truy cập vào trang chủ Zimbra đăng ký 1 tài khoản và lấy link download.

Hướng dẫn cài đặt Zimbra cơ bản trên CentOS 7

Sau khi copy đường dẫn download, các bạn tải source Zimbra về máy chủ.

wget https://files.zimbra.com/downloads/8.8.15_GA/zcs-8.8.15_GA_3869.RHEL7_64.20190918004220.tgz

Giải nén source zimbra vừa download về bằng cách chạy lệnh:

tar -xzvf zcs-8.8.15_GA_3869.RHEL7_64.20190918004220.tgz

Cài đặt Zimbra

cd zcs-8.8.15_GA_3869.RHEL7_64.20190918004220
./install.sh

Phần cài đặt có vẻ rất dài cho nên chúng tôi chỉ đề cập đến các bước lựa chọn chính trong phần cài đặt. Các bạn chú ý chọn cho đúng nhé.

root@mail zcs-8.8.15_GA_3869.RHEL7_64.20190918004220:~# ./install.sh
...

Do you agree with the terms of the software license agreement? [N] Y

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] Y

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.
...
The system will be modified.  Continue? [N] Y
...
    
Running Post Installation Configuration:
Operations logged to /tmp/zmsetup.20210625-112740.log
Installing LDAP configuration database...done.
Setting defaults...

DNS ERROR resolving MX for mail.systuts.net
It is suggested that the domain name have an MX record configured in DNS
Change domain name? [Yes] Yes
Create domain: [mail.systuts.net] systuts.net
        MX: mail.systuts.net (192.168.0.108)

        Interface: 127.0.0.1
        Interface: ::1
        Interface: 192.168.0.108
done.
Checking for port conflicts
...
    
....
Main menu

   1) Common Configuration:                                                  
   2) zimbra-ldap:                             Enabled                       
   3) zimbra-logger:                           Enabled                       
   4) zimbra-mta:                              Enabled                       
   5) zimbra-dnscache:                         Enabled                       
   6) zimbra-snmp:                             Enabled                       
   7) zimbra-store:                            Enabled                       
        +Create Admin User:                    yes                           
        +Admin user to create:                 [email protected]             
******* +Admin Password                        UNSET                         
        +Anti-virus quarantine user:           [email protected]
        +Enable automated spam training:       yes                           
        +Spam training user:                   [email protected]   
        +Non-spam(Ham) training user:          [email protected]     
        +SMTP host:                            mail.systuts.net              
        +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.systuts.net:7780/aspell.php
        +Enable version update checks:         TRUE                          
        +Enable version update notifications:  TRUE                          
        +Version update notification email:    [email protected]             
        +Version update source email:          [email protected]             
        +Install mailstore (service webapp):   yes                           
        +Install UI (zimbra,zimbraAdmin webapps): yes                           

   8) zimbra-spell:                            Enabled                       
   9) zimbra-proxy:                            Enabled                       
  10) Default Class of Service Configuration:                                
   s) Save config to file                                                    
   x) Expand menu                                                            
   q) Quit                                    

Address unconfigured (**) items  (? - help) 7
    
...		
Store configuration

   1) Status:                                  Enabled                       
   2) Create Admin User:                       yes                           
   3) Admin user to create:                    [email protected]             
** 4) Admin Password                           UNSET                         
   5) Anti-virus quarantine user:              [email protected]
   6) Enable automated spam training:          yes                           
   7) Spam training user:                      [email protected]   
   8) Non-spam(Ham) training user:             [email protected]     
   9) SMTP host:                               mail.systuts.net              
  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.systuts.net:7780/aspell.php
  19) Enable version update checks:            TRUE                          
  20) Enable version update notifications:     TRUE                          
  21) Version update notification email:       [email protected]             
  22) Version update source email:             [email protected]             
  23) Install mailstore (service webapp):      yes                           
  24) Install UI (zimbra,zimbraAdmin webapps): yes                           

Select, or 'r' for previous menu [r] 4

Password for [email protected] (min 6 characters): [Qsw2mjmWrP] <== Nhập password mới hoặc sử dụng password được cấp.
...
    
...
Store configuration

   1) Status:                                  Enabled                       
   2) Create Admin User:                       yes                           
   3) Admin user to create:                    [email protected]             
   4) Admin Password                           set                           
   5) Anti-virus quarantine user:              [email protected]
   6) Enable automated spam training:          yes                           
   7) Spam training user:                      [email protected]   
   8) Non-spam(Ham) training user:             [email protected]     
   9) SMTP host:                               mail.systuts.net              
  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.systuts.net:7780/aspell.php
  19) Enable version update checks:            TRUE                          
  20) Enable version update notifications:     TRUE                          
  21) Version update notification email:       [email protected]             
  22) Version update source email:             [email protected]             
  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-dnscache:                         Enabled                       
   6) zimbra-snmp:                             Enabled                       
   7) zimbra-store:                            Enabled                       
   8) zimbra-spell:                            Enabled                       
   9) zimbra-proxy:                            Enabled                       
  10) 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.9133] 
Saving config in /opt/zimbra/config.9133...done.
The system will be modified - continue? [No] Yes
Operations logged to /tmp/zmsetup.20210625-112740.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.
...
    
...
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.8.15_GA_3869_RHEL7_64)
        The ADMIN EMAIL ADDRESS created ([email protected])

Notify Zimbra of your installation? [Yes] Yes
Notification skipped
Checking if the NG started running...done. 
Setting up zimbra crontab...done.


Moving /tmp/zmsetup.20210625-112740.log to /opt/zimbra/log


Configuration complete - press return to exit Enter để thoát
...
    

Mở port dịch vụ

firewall-cmd --permanent --add-port={25,80,110,143,443,465,587,993,995,5222,5223,9071,7071}/tcp

Reload firewalld

firewall-cmd --reload   

Kiểm tra

Mở trình duyệt và truy cập https://mail.tenmiencuaban.com:7071 và login bằng tài khoản admin đã tạo ở trên.

Kết luận

Zimbra thật sự là một giải pháp tuyệt vời trong việc xây dựng máy chủ thư điện tử cho cả cá nhân và doanh nghiệp. Việc cung cấp Open source và hoàn toàn miễn phí giúp người dùng có thể tùy biến và tiết kiệm được chi phí đầu tư.

Hi vọng qua bài viết này các bạn có thể cài đặt Zimbra Server phục vụ cho nhu cầu của mình nhé. Nếu có bất kỳ góp ý gì vui lòng bình luận bên dưới.

Chúc các bạn thành công.

You may also like

Leave a Comment