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 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ỏ trên VPS.
1- Cấu hình máy chủ VPS tối thiểu.
- Ram: 2G
- HDD: 200G
- IP: 103.57.220.46
- Domain: kites.com.vn
- Mail domain: mail.kites.com.vn
2- Cài đặt
Bước 1: Trỏ tên miền về server.
Bước 2: Thực hiện SSH và máy chủ
2.1 – Đổi host name
1 | # vi /etc/hosts |
1 | # hostnamectl set-hostname new-hostnname |
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.2 – Update lại VPS đảm bảo các bản vá được update mới nhất.
1 | [root@mail ~]# yum update -y |
2.3 – 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/archives/
Coppy link đường dẫn để tải bản cài đặt
1 | [root@mail ~]# mkdir zimbrainstall |
1 | [root@mail ~]# cd zimbrainstall |
1 | [root@mail ~]# wget https://files.zimbra.com/downloads/8.7.0_GA/zcs-8.7.0_GA_1659.RHEL7_64.20160628202714.tgz |
2.4 Giải nén file vừa tải về
1 | [root@mail ~]# tar zxvf zcs-*.tgz |
Di chuyển vào thư mục vừa giải nén
1 | [root@mail ~]# cd zcs-* |
Chạy lệnh sau để bắt đầu tiến trình cài đặt
1 | [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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | 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 <<= GÕ 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 <<= GÕ Importing Zimbra GPG key Configuring package repository Select the packages to install Install zimbra-ldap [Y] y <<= GÕ Install zimbra-logger [Y] y <<= GÕ Install zimbra-mta [Y] y <<= GÕ Install zimbra-dnscache [Y] y <<= GÕ Install zimbra-snmp [Y] y <<= GÕ Install zimbra-store [Y] y <<= GÕ Install zimbra-apache [Y] y <<= GÕ Install zimbra-spell [Y] y <<= GÕ Install zimbra-memcached [Y] y <<= GÕ Install zimbra-proxy [Y] y <<= GÕ 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 <<= CHỌ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-dnscache zimbra-snmp zimbra-store zimbra-apache zimbra-spell zimbra-proxy selected for installation Monitor /tmp/install.log.xD4sSvlE for package installation progress Remote package installation started Installing zimbra-core-components zimbra-ldap-components zimbra-mta-components zimbra-dnscache-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-dnscache zimbra-snmp zimbra-store zimbra-apache zimbra-spell zimbra-proxy...done Operations logged to /tmp/zmsetup.20160811-181156.log Installing LDAP configuration database...done. Setting defaults... DNS ERROR resolving MX for mail.kites.com.vn It is suggested that the domain name have an MX record configured in DNS Enter domain name? [Yes] kites.com.vn <<= done. Checking for port conflicts Port conflict detected: 25 (zimbra-mta) Port conflict detected: 25 (zimbra-mta) Port conflicts detected! - Press Enter/Return key to continue 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: admin@mail.kites.com.vn ******* +Admin Password UNSET +Anti-virus quarantine user: virus-quarantine.finuy0pjm2@mail.kites.com.vn +Enable automated spam training: yes +Spam training user: spam.biwgithay@mail.kites.com.vn +Non-spam(Ham) training user: ham.i0z1dltvq@mail.kites.com.vn +SMTP host: mail.kites.com.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://mail.kites.com.vn:7780/aspell.php +Enable version update checks: TRUE +Enable version update notifications: TRUE +Version update notification email: admin@mail.kites.com.vn +Version update source email: admin@mail.kites.com.vn +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 <<= GÕ Store configuration 1) Status: Enabled 2) Create Admin User: yes 3) Admin user to create: admin@mail.kites.com.vn ** 4) Admin Password UNSET 5) Anti-virus quarantine user: virus-quarantine.finuy0pjm2@mail.kites.com.vn 6) Enable automated spam training: yes 7) Spam training user: spam.biwgithay@mail.kites.com.vn 8) Non-spam(Ham) training user: ham.i0z1dltvq@mail.kites.com.vn 9) SMTP host: mail.kites.com.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://mail.kites.com.vn:7780/aspell.php 19) Enable version update checks: TRUE 20) Enable version update notifications: TRUE 21) Version update notification email: admin@mail.kites.com.vn 22) Version update source email: admin@mail.kites.com.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@mail.kites.com.vn (min 6 characters): [PVFcVwqt7c] abcd@123 <<= Nhập mật khẩu email admin Store configuration 1) Status: Enabled 2) Create Admin User: yes 3) Admin user to create: admin@mail.kites.com.vn 4) Admin Password set 5) Anti-virus quarantine user: virus-quarantine.finuy0pjm2@mail.kites.com.vn 6) Enable automated spam training: yes 7) Spam training user: spam.biwgithay@mail.kites.com.vn 8) Non-spam(Ham) training user: ham.i0z1dltvq@mail.kites.com.vn 9) SMTP host: mail.kites.com.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://mail.kites.com.vn:7780/aspell.php 19) Enable version update checks: TRUE 20) Enable version update notifications: TRUE 21) Version update notification email: admin@mail.kites.com.vn 22) Version update source email: admin@mail.kites.com.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-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 <<= GÕ Save configuration data to a file? [Yes] yes <<= GÕ Save config in file: [/opt/zimbra/config.23729] yes <<= GÕ Saving config in yes...done. The system will be modified - continue? [No] yes <<= GÕ Operations logged to /tmp/zmsetup.20160811-181156.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.kites.com.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.kites.com.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.kites.com.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.kites.com.vn...done. Adding mail.kites.com.vn to zimbraMailHostPool in default COS...done. Creating domain mail.kites.com.vn...done. Setting default domain name...done. Creating domain mail.kites.com.vn...already exists. Creating admin account admin@mail.kites.com.vn...done. Creating root alias...done. Creating postmaster alias...done. Creating user spam.biwgithay@mail.kites.com.vn...done. Creating user ham.i0z1dltvq@mail.kites.com.vn...done. Creating user virus-quarantine.finuy0pjm2@mail.kites.com.vn...done. Setting spam training and Anti-virus quarantine accounts...done. Initializing store sql database...done. Setting zimbraSmtpHostname for mail.kites.com.vn...done. Configuring SNMP...done. Setting up syslog.conf...done. Starting servers...done. Installing common zimlets... com_zimbra_mailarchive...done. com_zimbra_phone...done. com_zimbra_ymemoticons...done. com_zimbra_cert_manager...done. com_zimbra_attachcontacts...done. com_zimbra_webex...done. com_zimbra_email...done. com_zimbra_viewmail...done. com_zimbra_bulkprovision...done. com_zimbra_proxy_config...done. com_zimbra_date...done. com_zimbra_attachmail...done. com_zimbra_srchhighlighter...done. com_zimbra_clientuploader...done. com_zimbra_adminversioncheck...done. com_zimbra_url...done. com_zimbra_tooltip...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@mail.kites.com.vn) Notify Zimbra of your installation? [Yes] yes <<= GÕ Notifying Zimbra of installation via http://www.zimbra.com/cgi-bin/notify.cgi?VER=8.7.0_GA_1659_RHEL7_64&MAIL=admin@mail.kites.com.vn Notification complete Setting up zimbra crontab...done. Moving /tmp/zmsetup.20160811-181156.log to /opt/zimbra/log Configuration complete - press return to exit Enter <<= GÕ |
Như vậy là hoàn thành bước cài đặt cơ bản cho email zimbra trên server.
Bước 3: Cấu hình mở port trên iptables
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | [root@mail ~]# iptables -A INPUT -p udp -m udp --dport 161 -j ACCEPT [root@mail ~]# iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT [root@mail ~]# iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT [root@mail ~]# iptables -A INPUT -p tcp -m tcp --dport 25 -j ACCEPT [root@mail ~]# iptables -A INPUT -p tcp -m tcp --dport 2220 -j ACCEPT [root@mail ~]# iptables -A INPUT -p tcp -m tcp --dport 110 -j ACCEPT [root@mail ~]# iptables -A INPUT -p tcp -m tcp --dport 143 -j ACCEPT [root@mail ~]# iptables -A INPUT -p tcp -m tcp --dport 389 -j ACCEPT [root@mail ~]# iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT [root@mail ~]# iptables -A INPUT -p tcp -m tcp --dport 587 -j ACCEPT [root@mail ~]# iptables -A INPUT -p tcp -m tcp --dport 465 -j ACCEPT [root@mail ~]# iptables -A INPUT -p tcp -m tcp --dport 993 -j ACCEPT [root@mail ~]# iptables -A INPUT -p tcp -m tcp --dport 995 -j ACCEPT [root@mail ~]# iptables -A INPUT -p tcp -m tcp --dport 7071 -j ACCEPT [root@mail ~]# iptables -A INPUT -p tcp -m tcp --dport 7780 -j ACCEPT [root@mail ~]# iptables -A INPUT -p tcp -m tcp --dport 8443 -j ACCEPT |
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.
1 | [root@mail ~]# systemctl restart iptables |
Bước 4: Tắt một số service send mail mặc định trên hệ thống
1 2 3 | [root@mail ~]# systemctl stop postfix.service [root@mail ~]# systemctl disable postfix.service |
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
https://mail.kites.com.vn:7071
Đăng nhập bằng tài khoản admin; và mật khẩu đã tạo ở bước trệ
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 !