Zimbra on EC2 tips
提供:雑多なメモ Wiki版
(32bit 版が DEPRECATED なのと AWS の新機能に対応する為に書き換えました)
Zimbra Collaboration Suite (ZCS) Open Source Edition を Amazon EC2 で稼働させる際の Tips です。
EC2のインスタンスはプライベートIPアドレス空間で稼働しており、グローバルIPアドレス空間とは(Elastic IPでも)1:1のNATのような構成になっています。 その為、Zimbra の(一般的なメールサーバも) EC2 へのインストールには若干のコツが必要です。
以下で説明する構成は、簡単に Zimbra を導入する事を目的としているので、マルチマシン構成に拡張する事はあまり想定していません。
- (AWS Cloud Formation という機能がリリースされたので、マルチマシン構成も簡単にできるようになるはずです。検証後 wiki にあげる予定です)
目次 |
前準備
ここで、お好みの Linux ディストリビューションの Zimbra パッケージが有るかどうか確認してください。
私は debian 派なのであるのと、EC2 での実績と安定性を重視して Ubuntu GNU/Linux を推奨します。
Ubuntu の安定版である 10.04 LTS (Lucid Lynx) AMI を使用します。Ubuntu 10.04 LTS (Lucid Lynx)から、使用する Region の 64bit arch で ebs backed な AMI を選択します。
instance type は 64bit という事と、Zimbra が Java base でリソース食いなので m1.large で起動します。
Security Group で SSH を許可しておきます。
zimbra は /opt/zimbra にサーバやモジュールがまとまって入るので、後々の拡張の事を考えて、/opt には EBS volume を assign して使用します。利用容量にあわせて確保します。(私は 30GB アサインしました)
メールサーバなので Elastic IP を 1個 allocate して、instance に associate しておきます。
DNS
DNSサーバの設定をします。DNSサーバはドメイン・レジストラが提供しているサービスを使うのが簡単です。
- (Amazon Route 53 という DNSサーバ機能がリリースされています。検証後 wiki に反映します)
ドメイン名を仮に example.com とします。また、Elastic IP でアロケートされたグローバルIPアドレスを仮に 192.168.1.1 とします。 メールサーバの名前を aws.example.com とした場合、DNS の A RR に、
aws.example.com. IN A 192.168.1.1
MX RR に、
example.com. IN MX 10 aws.example.com.
TXT RR に、おまじないとして classic SPF も書いておきましょう。
example.com. IN TXT "v=spf1 ip4:192.168.1.1 ~all"
あとは、DNS の情報が反映されるのを待って、確認できたら次の作業にかかります。
次に、AWS に DNSの逆引きレコードの設定を依頼します。このフォームから申請します。
- (右上の言語を日本語にすると、日本人スタッフにもメールが届くそうです)
インスタンス
Zimbra を導入する instance を 起動します。(m1.large, 64bit, ebs-backed ami-2ec83147 )
- Canonical版の AMI は "ubuntu" ユーザで slogin します
最初に TZ を 'Asia/Tokyo' にしておきます。
echo "Asia/Tokyo" | sudo tee /etc/timezone sudo dpkg-reconfigure --frontend noninteractive tzdata
TZ に変更により影響のあるサービスを再起動します。
sudo service rsyslog restart sudo service cron restart
真っ新なインスタンスなので、一度パッケージのアップデートを行います。
sudo aptitude update sudo aptitude -y safe-upgrade
kernel の更新等の reboot を伴う update がなされた場合は、一旦 reboot します。
create volume した EBS を instance に attach して mkfs 、余計なお世話を止めさせる ;) おまじないをした後、 /opt に mount しておきます。
sudo mkfs.ext3 /dev/sdf sudo tune2fs -c -1 -i 0 /dev/sdf sudo mount -o defaults,relatime /dev/sdf /opt
/etc/fstab に EBS ボリュームのマウント情報を書きます。
/dev/sdf /opt ext3 defaults,relatime 0 0
内部 DNS
EC2 のインスタンスは、stop や terminate した際に、プライベートIPアドレスを解放してしまい、再度インスタンスを起動した場合、次に割り当てられるプライベートIPアドレスは以前と変わってしまいます。
その為に、Zimbra を最初にインストールした際の、"logical hostname" ではプライベートIPアドレスが変わってしまっているので、LDAP サーバが bind できない、という事態に陥ります。 それを避けるために、内部 DNS サーバを立ち上げて、導入時に真の意味での、論理ホスト名になるような "logical hostname" を指定して、インスタンス起動時に割り当てられたプライベートIPアドレスに都度対応できるようにします。
sudo aptitude -y install bind9 sudo aptitude install python-ipy
/etc/bind にある設定を変えて、ややトリッキーな設定を仕込みます。 今回の例でいえば、aws.example.com という zone の権威情報を持ち、 aws.example.com. の A RR に現在のプライベートIPアドレスを指定する形になります。 (Split DNS)
(古い ubuntu ec2-init パッケージから流用しました)
/usr/local/etc/init に配置、実行権限を付与します。
ec2-set-hosts
#!/usr/bin/python # # Set up the hostname for ec2. # Copyright 2008 Canonical Ltd. # # Author: Chuck Short <chuck.short@canonical.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # import urllib import os from Cheetah.Template import Template api_ver = '2011-01-01' metadata = None base_url = 'http://169.254.169.254/%s/meta-data' % api_ver my_hostname = urllib.urlopen('%s/local-hostname/' % base_url).read() my_ip = urllib.urlopen('%s/local-ipv4/' % base_url).read() my_fqdn = os.popen("/bin/cat /etc/hostname").read().rstrip() # replace the ubuntu hostname in /etc/hosts mp = {'localipv4' : my_ip, 'hostname' : my_hostname, 'fqdn' : my_fqdn} t = Template(file="/usr/local/etc/bind/templates/hosts.tmpl", searchList=[mp]) os.system("rm -f /etc/hosts") f = open("/etc/hosts", "w") f.write('%s' %(t)) f.close()
sudo chmod +x /usr/local/etc/init/ec2-set-hosts
/usr/local/etc/bind/templates/hosts.tmpl
127.0.0.1 localhost #127.0.1.1 $hostname $localipv4 $fqdn # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts
/usr/local/etc/init に配置して、実行権限を付与します。
ec2-set-dns-zone (内部 DNS 設定用)
#!/usr/bin/python # # Set up the hostname for ec2. # Copyright 2008 Canonical Ltd. # # Author: Chuck Short <chuck.short@canonical.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # import urllib import os from Cheetah.Template import Template from IPy import IP api_ver = '2011-01-01' metadata = None base_url = 'http://169.254.169.254/%s/meta-data' % api_ver my_ip = urllib.urlopen('%s/local-ipv4/' % base_url).read() my_fqdn = os.popen("/bin/cat /etc/hostname").read().rstrip() ip = IP(my_ip) my_arpa = ip.reverseName().rstrip('.') # replace the Split DNS host ip address in /etc/bind/db.myzone mp = {'localipv4' : my_ip} t = Template(file="/usr/local/etc/bind/templates/zone.tmpl", searchList=[mp]) os.system("rm -f /etc/bind/db.myzone") f = open("/etc/bind/db.myzone", "w") f.write('%s' %(t)) f.close() # replace the Split DNS host ip address in /etc/bind/db.myarpa mp = {'fqdn' : my_fqdn} t = Template(file="/usr/local/etc/bind/templates/arpa.tmpl", searchList=[mp]) os.system("rm -f /etc/bind/db.myarpa") f = open("/etc/bind/db.myarpa", "w") f.write('%s' %(t)) f.close() # replace the Split DNS host ip address in /etc/bind/myzone.conf mp = {'fqdn' : my_fqdn, 'arpa' : my_arpa} t = Template(file="/usr/local/etc/bind/templates/conf.tmpl", searchList=[mp]) os.system("rm -f /etc/bind/myzone.conf") f = open("/etc/bind/myzone.conf", "w") f.write('%s' %(t)) f.close()
sudo chmod +x /usr/local/etc/init/ec2-set-dns-zone
/usr/local/etc/bind/templates/zone.tmpl
; ; BIND data file for Split DNS ; @ 604800 IN SOA localhost. root.localhost. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ 604800 IN NS localhost. @ 604800 IN A $localipv4 @ 604800 IN MX 10 @
/usr/local/etc/bind/templates/zone.tmpl
; ; BIND data file for Split DNS ; @ 604800 IN SOA localhost. root.localhost. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ 604800 IN NS localhost. @ 604800 IN PTR $fqdn.
/usr/local/etc/bind/templates/conf.tmpl
zone "$fqdn" {
type master;
file "/etc/bind/db.myzone";
};
zone "$arpa" {
type master;
file "/etc/bind/db.myarpa";
};
/etc/bind/named.conf.local に以下を追加する
include "/etc/bind/myzone.conf";
/etc/bind/named.conf.options の forwarders を EC2 の内部 DNS サーバに設定
forwarders {
172.16.0.23;
};
/etc/bind/named.conf.options の listen address 制限しておく
// listen-on-v6 { any; };
listen-on { 127.0.0.1; };
listen-on-v6 { ::1; };
起動スクリプトとしてリンク
sudo ln -s /usr/local/etc/init/ec2-set-hosts /etc/rc2.d/S12ec2-set-hosts sudo ln -s /usr/local/etc/init/ec2-set-dns-zone /etc/rc2.d/S13ec2-set-dns-zone
dhcp client が自動生成する /etc/resolv.conf に反映する為に、/etc/dhcp3/dhclient.conf を修正します。
prepend domain-name-servers 127.0.0.1; supersede domain-name "example.com";
/etc/hostname に fqdn (この場合は aws.example.com) を設定します。
echo "aws.example.com" | sudo tee /etc/hostname sudo /bin/hostname -F /etc/hostname
ここで一度この script を起動して動作確認します。
sudo /usr/local/etc/init/ec2-set-hosts cat /etc/hosts
sudo /usr/local/etc/init/ec2-set-dns-zone sudo /etc/init.d/bind9 restart dig @localhost aws.example.com
ここで一旦 reboot します。
パッケージ
Zimbra に必要なパッケージを導入します。
sudo aptitude install libperl5.10 sudo aptitude install sysstat sudo aptitude install sqlite3
セキュリティグループ
EC2 の Security Group で Zimbra に必要な port を設定します。
SMTP 25 HTTP 80 HTTPS 443 IMAP 143 IMAP (Secure) 993 POP3 110 POP3 (Secure) 995 Custom で 7071 (Administration Console)
もちろん、使わないサービスの port は閉じておくべきです。
AMI 登録
念のため、この段階のインスタンスをAMIに登録しておきます。
インストールに失敗したら、この AMI を起動してやり直しましょう。
導入
これで前準備ができたので、Zimbra を導入(インストール)します。
- ここからは sudo su - で root 権限で作業します。(sudo -i は環境変数問題があるので使わない)
Zimbra のサイトから、パッケージを EC2 の EBS ボリュームに持って展開しておきます。
cd /opt wget http://files2.zimbra.com/downloads/7.1.0_GA/zcs-7.1.0_GA_3140.UBUNTU10_64.20110329151347.tgz tar xfz zcs-7.1.0_GA_3140.UBUNTU10_64.20110329151347.tgz cd zcs-7.1.0_GA_3140.UBUNTU10_64.20110329151347
コンフィグレーション
Zimbra のパッケージを展開したディレクトリで、
./install.shインストーラーが起動します。 <RETURN>と書いてあるところで入力待ちがあります。
Operations logged to /tmp/install.log.9999
Checking for existing installation...
zimbra-ldap...NOT FOUND
zimbra-logger...NOT FOUND
zimbra-mta...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-cluster...NOT FOUND
zimbra-core...NOT FOUND
PLEASE READ THIS AGREEMENT CAREFULLY BEFORE USING THE SOFTWARE.
ZIMBRA, INC. ("ZIMBRA") 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 the Zimbra Collaboration Suite:
http://www.zimbra.com/license/zimbra_public_eula_2.1.html
Do you agree with the terms of the software license agreement? [N] Y<RETURN>
Checking for prerequisites...
FOUND: NPTL
FOUND: sudo-1.7.2p1-1ubuntu5.3
FOUND: libidn11-1.15-2
FOUND: libpcre3-7.8-3build1
FOUND: libgmp3c2-2:4.3.2+dfsg-1ubuntu1
FOUND: libexpat1-2.0.1-7ubuntu1
FOUND: libstdc++6-4.4.3-4ubuntu5
FOUND: libperl5.10-5.10.1-8ubuntu2.1
Checking for suggested prerequisites...
FOUND: perl-5.10.1
FOUND: sysstat
FOUND: sqlite3
Prerequisite check complete.
Checking for installable packages
Found zimbra-core
Found zimbra-ldap
Found zimbra-logger
Found zimbra-mta
Found zimbra-snmp
Found zimbra-store
Found zimbra-apache
Found zimbra-spell
Found zimbra-memcached
Found zimbra-proxy
Select the packages to install
Install zimbra-ldap [Y] <RETURN>
Install zimbra-logger [Y] <RETURN>
Install zimbra-mta [Y] <RETURN>
Install zimbra-snmp [Y] <RETURN>
Install zimbra-store [Y] <RETURN>
Install zimbra-apache [Y] <RETURN>
Install zimbra-spell [Y] <RETURN>
Install zimbra-memcached [N] <RETURN>
Install zimbra-proxy [N] <RETURN>
Checking required space for zimbra-core
checking space for zimbra-store
Installing:
zimbra-core
zimbra-ldap
zimbra-logger
zimbra-mta
zimbra-snmp
zimbra-store
zimbra-apache
zimbra-spell
The system will be modified. Continue? [N] Y<RETURN>
Removing /opt/zimbra
Removing zimbra crontab entry...done.
Cleaning up zimbra init scripts...done.
Cleaning up /etc/ld.so.conf...done.
Cleaning up /etc/security/limits.conf...done.
Finished removing Zimbra Collaboration Suite.
Installing packages
zimbra-core......zimbra-core_7.1.0_GA_3140.UBUNTU10_64_amd64.deb...done
zimbra-ldap......zimbra-ldap_7.1.0_GA_3140.UBUNTU10_64_amd64.deb...done
zimbra-logger......zimbra-logger_7.1.0_GA_3140.UBUNTU10_64_amd64.deb...done
zimbra-mta......zimbra-mta_7.1.0_GA_3140.UBUNTU10_64_amd64.deb...done
zimbra-snmp......zimbra-snmp_7.1.0_GA_3140.UBUNTU10_64_amd64.deb...done
zimbra-store......zimbra-store_7.1.0_GA_3140.UBUNTU10_64_amd64.deb...done
zimbra-apache......zimbra-apache_7.1.0_GA_3140.UBUNTU10_64_amd64.deb...done
zimbra-spell......zimbra-spell_7.1.0_GA_3140.UBUNTU10_64_amd64.deb...done
Operations logged to /tmp/zmsetup.99999999-999999.log
Installing LDAP configuration database...done.
Setting defaults... MX: aws.example.com (10.XXX.XXX.XXX)
Interface: 10.XXX.XXX.XXX
Interface: 127.0.0.1
10.XXX.XXX.XXX
done.
Checking for port conflicts
Main menu
1) Common Configuration:
2) zimbra-ldap: Enabled
3) zimbra-store: Enabled
+Create Admin User: yes
+Admin user to create: admin@aws.example.com
******* +Admin Password UNSET
+Anti-virus quarantine user: virus-quarantine.xxxxxxxxx@aws.example.com
+Enable automated spam training: yes
+Spam training user: spam.xxxxxxxxx@aws.example.com
+Non-spam(Ham) training user: ham.xxxxxxxxx@aws.example.com
+SMTP host: aws.example.com
+Web server HTTP port: 80
+Web server HTTPS port: 443
+Web server mode: http
+IMAP server port: 143
+IMAP server SSL port: 993
+POP server port: 110
+POP server SSL port: 995
+Use spell check server: yes
+Spell server URL: http://aws.example.com:7780/aspell.php
+Configure for use with mail proxy: FALSE
+Configure for use with web proxy: FALSE
+Enable version update checks: TRUE
+Enable version update notifications: TRUE
+Version update notification email: admin@aws.example.com
+Version update source email: admin@aws.example.com
4) zimbra-mta: Enabled
5) zimbra-snmp: Enabled
6) zimbra-logger: Enabled
7) zimbra-spell: Enabled
8) Default Class of Service Configuration:
r) Start servers after configuration yes
s) Save config to file
x) Expand menu
q) Quit
Address unconfigured (**) items (? - help) 1<RETURN>
Common configuration
1) Hostname: aws.example.com
2) Ldap master host: aws.example.com
3) Ldap port: 389
4) Ldap Admin password: set
5) Secure interprocess communications: yes
6) TimeZone: America/Los_Angeles
Select, or 'r' for previous menu [r] 6<RETURN>
1 Africa/Algiers
|略|
60 Asia/Tokyo
|略|
92 UTC
Enter the number for the local timezone: [23] 60<RETURN>
Common configuration
1) Hostname: aws.example.com
2) Ldap master host: aws.example.com
3) Ldap port: 389
4) Ldap Admin password: set
5) Secure interprocess communications: yes
6) TimeZone: Asia/Tokyo
Select, or 'r' for previous menu [r] <RETURN>
Main menu
1) Common Configuration:
2) zimbra-ldap: Enabled
3) zimbra-store: Enabled
+Create Admin User: yes
+Admin user to create: admin@aws.example.com
******* +Admin Password UNSET
+Anti-virus quarantine user: virus-quarantine.xxxxxxxxx@aws.example.com
+Enable automated spam training: yes
+Spam training user: spam.xxxxxxxxx@aws.example.com
+Non-spam(Ham) training user: ham.xxxxxxxxx@aws.example.com
+SMTP host: aws.example.com
+Web server HTTP port: 80
+Web server HTTPS port: 443
+Web server mode: http
+IMAP server port: 143
+IMAP server SSL port: 993
+POP server port: 110
+POP server SSL port: 995
+Use spell check server: yes
+Spell server URL: http://aws.example.com:7780/aspell.php
+Configure for use with mail proxy: FALSE
+Configure for use with web proxy: FALSE
+Enable version update checks: TRUE
+Enable version update notifications: TRUE
+Version update notification email: admin@aws.example.com
+Version update source email: admin@aws.example.com
4) zimbra-mta: Enabled
5) zimbra-snmp: Enabled
6) zimbra-logger: Enabled
7) zimbra-spell: Enabled
8) Default Class of Service Configuration:
r) Start servers after configuration yes
s) Save config to file
x) Expand menu
q) Quit
Address unconfigured (**) items (? - help) 3<RETURN>
Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@aws.example.com
** 4) Admin Password UNSET
5) Anti-virus quarantine user: virus-quarantine.xxxxxxxxx@aws.example.com
6) Enable automated spam training: yes
7) Spam training user: spam.xxxxxxxxx@aws.example.com
8) Non-spam(Ham) training user: ham.xxxxxxxxx@aws.example.com
9) SMTP host: aws.example.com
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: http
13) IMAP server port: 143
14) IMAP server SSL port: 993
15) POP server port: 110
16) POP server SSL port: 995
17) Use spell check server: yes
18) Spell server URL: http://aws.example.com:7780/aspell.php
19) Configure for use with mail proxy: FALSE
20) Configure for use with web proxy: FALSE
21) Enable version update checks: TRUE
22) Enable version update notifications: TRUE
23) Version update notification email: admin@aws.example.com
24) Version update source email: admin@aws.example.com
Select, or 'r' for previous menu [r] 4<RETURN>
Password for admin@aws.example.com (min 6 characters): [XXXXXXXXX] パスワード<RETURN>
Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@aws.example.com
4) Admin Password set
5) Anti-virus quarantine user: virus-quarantine.xxxxxxxxx@aws.example.com
6) Enable automated spam training: yes
7) Spam training user: spam.xxxxxxxxx@aws.example.com
8) Non-spam(Ham) training user: ham.xxxxxxxxx@aws.example.com
9) SMTP host: aws.example.com
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: http
13) IMAP server port: 143
14) IMAP server SSL port: 993
15) POP server port: 110
16) POP server SSL port: 995
17) Use spell check server: yes
18) Spell server URL: http://aws.example.com:7780/aspell.php
19) Configure for use with mail proxy: FALSE
20) Configure for use with web proxy: FALSE
21) Enable version update checks: TRUE
22) Enable version update notifications: TRUE
23) Version update notification email: admin@aws.example.com
24) Version update source email: admin@aws.example.com
Select, or 'r' for previous menu [r] 12<RETURN>
Please enter the web server mode (http,https,both,mixed,redirect) [http] https<RETURN>
Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@aws.example.com
4) Admin Password set
5) Anti-virus quarantine user: virus-quarantine.xxxxxxxxx@aws.example.com
6) Enable automated spam training: yes
7) Spam training user: spam.xxxxxxxxx@aws.example.com
8) Non-spam(Ham) training user: ham.xxxxxxxxx@aws.example.com
9) SMTP host: aws.example.com
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: https
13) IMAP server port: 143
14) IMAP server SSL port: 993
15) POP server port: 110
16) POP server SSL port: 995
17) Use spell check server: yes
18) Spell server URL: http://aws.example.com:7780/aspell.php
19) Configure for use with mail proxy: FALSE
20) Configure for use with web proxy: FALSE
21) Enable version update checks: TRUE
22) Enable version update notifications: TRUE
23) Version update notification email: admin@aws.example.com
24) Version update source email: admin@aws.example.com
Select, or 'r' for previous menu [r] <RETURN>
Main menu
1) Common Configuration:
2) zimbra-ldap: Enabled
3) zimbra-store: Enabled
4) zimbra-mta: Enabled
5) zimbra-snmp: Enabled
6) zimbra-logger: Enabled
7) zimbra-spell: Enabled
8) Default Class of Service Configuration:
r) Start servers after configuration yes
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<RETURN>
Save configuration data to a file? [Yes] <RETURN>
Save config in file: [/opt/zimbra/config.9999]
Saving config in /opt/zimbra/config.9999...done.
The system will be modified - continue? [No] Yes<RETURN>
|略|
You have the option of notifying Zimbra of your installation.
This helps us to track the uptake of the Zimbra Collaboration Suite.
The only information that will be transmitted is:
The VERSION of zcs installed (7.1.0_GA_3140_UBUNTU10_64)
The ADMIN EMAIL ADDRESS created (admin@aws.example.com)
Notify Zimbra of your installation? [Yes] No<RETURN> (通知を望むならYes)
|略|
Configuration complete - press return to exit <RETURN>
Zimbra が正常に稼働しているか確認します。
root@aws:/opt/zcs-7.1.0_GA_3140.UBUNTU10_64.20110329151347# su - zimbra zimbra@aws:~$ zmcontrol status Host aws.example.com antispam Running antivirus Running ldap Running logger Running mailbox Running mta Running snmp Running spell Running stats Running zmconfigd Running
Zimbra Administration Console
無事にインストールが終了したら、 Zimbra Administration Console にログインします。
https://aws.example.com:7071/
証明書は「オレオレ証明書」になっているので、警告が出ますが、継続してください。
低価格のドメイン名認証のサーバ証明書を購入するのもいいでしょう。
MTA信頼ネットワークで、インスタンスのプライベートIPアドレスが /23 のネットワークになっているので、/32 のホストに制限します。
設定 -> サーバ -> aws.example.com -> MTA -> MTA信頼ネットワーク
また、インスタンスのプライベートIPアドレスが変わっている場合は、現在のインスタンスのプライベートIPアドレスを設定してください。
(これも古い ec2-init から流用して EC2 Instance Metadata から自動設定する script を書きました)
#!/usr/bin/python # # Set up the hostname for ec2. # Copyright 2008 Canonical Ltd. # # Author: Chuck Short <chuck.short@canonical.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # import urllib import os api_ver = '2011-01-01' metadata = None base_url = 'http://169.254.169.254/%s/meta-data' % api_ver my_ip = urllib.urlopen('%s/local-ipv4/' % base_url).read() my_fqdn = os.popen("/bin/cat /etc/hostname").read().rstrip() my_cmd = 'zmprov modifyServer %s zimbraMtaMyNetworks \'127.0.0.0/8 %s/32\'' % (my_fqdn, my_ip,) os.system('su - zimbra -c \"%s\"' % my_cmd) os.system('su - zimbra -c \"postfix reload\"')
もし、@example.com でメールを受け取りたい場合は、domain を追加します。(DNSの設定ももちろん必要です)
設定 -> ドメイン -> 新規
OS からのメールを受け取る
Sending Mail from Terminal (optional)
wget http://ubuntu.lnix.net/misc/mta-dummy/mta-dummy_1.0_all.deb dpkg -i mta-dummy_1.0_all.deb aptitude install bsd-mailx Add the following to /etc/mail.rc: set sendmail=/opt/zimbra/postfix/sbin/sendmail
起動用 AMI 登録
Zimbra の 導入が終わったら、AMI の登録をします。
その他
m1.large は EC2 Reserved Instances を購入すると、月額単価が m1.small 並みになるの、常時運用する場合はおすすめです。
