最近因爲有商業使用上的需求,因此研究如何架設Opensource Zimbra。當然要架設Opensource Zimbra 就是要搭配免費的Linux系統,在此就選擇了相容性與穩定性兼具的CentOS。
CentOS系統安裝與設定
下載CentOS 6.0 64bit ISO檔桉 (http://ftp.tc.edu.tw/Linux/CentOS/6/isos/x86_64/CentOS-6.0-x86_64-bin-DVD1.iso)
燒錄光碟 (若使用VMWare,則複製到伺服器後,選擇光碟機並指向該ISO檔桉)
安裝 CentOS 6.0
安裝過程中,可選擇硬碟partition分割爲: BOOT/100MB,SWAP/4000MB,其餘的空間設定LVM並分割給 /。
選擇安裝爲 Basic Server。
安裝完成後重開機。
以root帳號登入。
設定網卡IP[root@mail ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0″HWADDR="09:00:26:70:84:BE"NM_CONTROLLED="no"ONBOOT="yes"
BOOTPROTO=none
IPADDR=192.168.32.156
NETMASK=255.255.255.0
GATEWAY=192.168.32.254
DNS 伺服器的 IP 設定[root@mail ~]# vi /etc/resolv.confnameserver 127.0.0.1nameserver 168.95.1.1
設定 network 檔桉[root@mail ~]# vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=mail.domainname.com
設定 network 檔桉[root@mail ~]# vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=mail.domainname.com
設定 hosts 檔桉[root@mail ~]# vi /etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.32.156 mail.domainname.com mail
停用SELinux[root@mail ~]# vi /etc/selinux/config
SELINUX=diabledSELINUXTYPE=targeted
停用iptables / ip6tables[root@mail ~]# chkconfig iptables off
[root@mail ~]# chkconfig ip6tables off
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.32.156 mail.domainname.com mail
停用SELinux[root@mail ~]# vi /etc/selinux/config
SELINUX=diabledSELINUXTYPE=targeted
停用iptables / ip6tables[root@mail ~]# chkconfig iptables off
[root@mail ~]# chkconfig ip6tables off
更新系統檔桉[root@mail ~]# yum –y update
安裝必要元件[root@mail ~]# yum install -y mysql sysstat perl sudo sqlite libstdc++-4.4.4-13.el6.i686 bind bind-chroot nc.x86_64
建立domainname.com檔桉[root@mail ~]# vi /var/named/chroot/var/named/domainname.com
並寫入以下內容:
;
; Addresses and other host information.
;
@ IN SOA domainname.com. admin.domainname.com. (
2011030801 ; Serial
43200 ; Refresh
3600 ; Retry
3600000 ; Expire
2592000 ) ; Minimum
; Define the nameservers and the mail servers
IN NS ns.domainname.com.
IN A 192.168.32.156
IN MX 10 mail.domainname.com.mail IN A 192.168.32.156
ns IN A 192.168.32.156
並寫入以下內容:
;
; Addresses and other host information.
;
@ IN SOA domainname.com. admin.domainname.com. (
2011030801 ; Serial
43200 ; Refresh
3600 ; Retry
3600000 ; Expire
2592000 ) ; Minimum
; Define the nameservers and the mail servers
IN NS ns.domainname.com.
IN A 192.168.32.156
IN MX 10 mail.domainname.com.mail IN A 192.168.32.156
ns IN A 192.168.32.156
修改 named.conf 檔桉[root@mail ~]# vi /var/named/chroot/etc/named.conf
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";statistics-file "/var/named/data/named_stats.txt";
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";statistics-file "/var/named/data/named_stats.txt";
forwarders { 127.0.0.1; };
};
include "/etc/rndc.key";
// We are the master server for mydomain.com
zone "domainname.com" {
type master;
file "domainname.com";
};
啓用 DNS 服務[root@mail ~]# /etc/init.d/named start
啓用 DNS 自動啓動[root@mail ~]# chkconfig named on
確認 DNS 正確運作中[root@mail ~]# host -t mx domainname.comdomainname.com mail is handled by 10 mail.domainname.com.[root@mail ~]# nslookup mail.domainname.comServer: 127.0.0.1
Address: 127.0.0.1#53
Address: 127.0.0.1#53
Name: mail.domainname.com
Address: 192.168.32.156
修改tty 設定[root@mail ~]# vi /etc/sudoers#Defaults requiretty
Zimbra 7.1.3 Opensource 系統安裝
Zimbra 7.1.3 Opensource 系統安裝
下載 Zimbra 7.1.3 Opensource[root@mail ~]# mkdir /download
[root@mail ~]# cd /download
[root@mail ~]# cd /download
[root@mail ~]# wget http://files.zimbra.com/downloads/7.1.3_GA/zcs-7.1.3_GA_3346.RHEL6_64.20110928134428.tgz
解壓縮 Zimbra 7.1.3 Opensource[root@mail ~]# tar -zxvf zcs-7.1.3_GA_3346.RHEL6_64.20110928134428.tgz
安裝 Zimbra 7.1.3 Opensource[root@mail ~]# cd zcs-7.1.3_GA_3346.RHEL6_64.20110928134428
[root@mail ~]# ./install.sh –platform-override
[root@mail ~]# ./install.sh –platform-override
安裝過程將會出現精靈式問答,請依照粗體字給予迴應:If you leave the question in blank, it will select the default option.Do you agree with the terms of the software license agreement? [N] y
下列安裝項目直接按ENTER即可。
下列安裝項目直接按ENTER即可。
Select the packages to install
Install zimbra-ldap [Y]
Install zimbra-logger [Y]
Install zimbra-mta [Y]
Install zimbra-snmp [Y]
Install zimbra-store [Y]
Install zimbra-apache [Y]
Install zimbra-spell [Y]
Install zimbra-memcached [N]
Install zimbra-proxy [N]You appear to be installing packages on a platform different
than the platform for which they were built.
Install zimbra-ldap [Y]
Install zimbra-logger [Y]
Install zimbra-mta [Y]
Install zimbra-snmp [Y]
Install zimbra-store [Y]
Install zimbra-apache [Y]
Install zimbra-spell [Y]
Install zimbra-memcached [N]
Install zimbra-proxy [N]You appear to be installing packages on a platform different
than the platform for which they were built.
This platform is UNKNOWN
Packages found: RHEL5_64
This may or may not work.
Packages found: RHEL5_64
This may or may not work.
Using packages for a platform in which they were not designed for
may result in an installation that is NOT usable. Your support
options may be limited if you choose to continue.
may result in an installation that is NOT usable. Your support
options may be limited if you choose to continue.
Install anyway? [N] y
The system will be modified. Continue? [N] y
The system will be modified. Continue? [N] y
當Zimbra 安裝完成後,會出現系統設定清單,這時,選擇3,然後4來設定admin的密碼。
輸入密碼完成後,選擇r,然後a來儲存設定。
最後安裝精靈會詢問是否通知Zimbra,輸入no。Notify Zimbra of your installation? [Yes] no
輸入密碼完成後,選擇r,然後a來儲存設定。
最後安裝精靈會詢問是否通知Zimbra,輸入no。Notify Zimbra of your installation? [Yes] no
其他資訊:
登入系統管理畫面https://mail.domainname.com:7071
或
登入系統管理畫面https://mail.domainname.com:7071
或
https://192.168.32.156:7071
如果忘記admin密碼需要重設,則:[root@mail ~]# su – zimbra
[zimbra@mail ~]# zmprov sp <admin email address> <new password>
[zimbra@mail ~]# zmprov sp <admin email address> <new password>
移除 Zimbra[root@mail ~]# cd /downloads
[root@mail ~]# ./install.sh –u
[root@mail ~]# cd /opt
[root@mail ~]# rm –rf zimbra
[root@mail ~]# ./install.sh –u
[root@mail ~]# cd /opt
[root@mail ~]# rm –rf zimbra