Zimbra on EC2 tips: Difference between revisions

 
(27 intermediate revisions by the same user not shown)
Line 1: Line 1:
[https://gienkin.jrc.or.jp/ http://s3.egrep.jp/jrclogo.gif]
(32bit 版が DEPRECATED なのと AWS の新機能に対応する為に書き換えました)
(32bit 版が DEPRECATED なのと AWS の新機能に対応する為に書き換えました)


Line 11: Line 8:
以下で説明する構成は、簡単に Zimbra を導入する事を目的としているので、マルチマシン構成に拡張する事はあまり想定していません。
以下で説明する構成は、簡単に Zimbra を導入する事を目的としているので、マルチマシン構成に拡張する事はあまり想定していません。
:(AWS Cloud Formation という機能がリリースされたので、マルチマシン構成も簡単にできるようになるはずです。検証後 wiki にあげる予定です)
:(AWS Cloud Formation という機能がリリースされたので、マルチマシン構成も簡単にできるようになるはずです。検証後 wiki にあげる予定です)
:(上は放置状態ですが、その後の要注意点(ハマり所)として Zimbra 8.5 以降は proxy は有効にする事。[zimbra-memcached と zimbra-proxy をインストールする事])


= 前準備 =
= 前準備 =
Line 32: Line 31:
ドメイン名を仮に example.com とします。また、Elastic IP でアロケートされたグローバルIPアドレスを仮に 192.168.1.1 とします。
ドメイン名を仮に example.com とします。また、Elastic IP でアロケートされたグローバルIPアドレスを仮に 192.168.1.1 とします。
メールサーバの名前を aws.example.com とした場合、DNS の A RR に、
メールサーバの名前を aws.example.com とした場合、DNS の A RR に、
aws.example.com. IN A 192.168.1.1
<syntaxhighlight lang="text" enclose="div">
aws.example.com. IN A 192.168.1.1
</syntaxhighlight>
MX RR に、
MX RR に、
example.com. IN MX 10 aws.example.com.
<syntaxhighlight lang="text" enclose="div">
example.com. IN MX 10 aws.example.com.
</syntaxhighlight>
 
TXT RR に、おまじないとして classic SPF も書いておきましょう。
TXT RR に、おまじないとして classic SPF も書いておきましょう。
example.com. IN TXT "v=spf1 ip4:192.168.1.1 ~all"
<syntaxhighlight lang="text" enclose="div">
 
example.com. IN TXT "v=spf1 ip4:192.168.1.1 ~all"
</syntaxhighlight>
あとは、DNS の情報が反映されるのを待って、確認できたら次の作業にかかります。
あとは、DNS の情報が反映されるのを待って、確認できたら次の作業にかかります。


Line 48: Line 53:


最初に TZ を 'Asia/Tokyo' にしておきます。
最初に TZ を 'Asia/Tokyo' にしておきます。
<syntaxhighlight>
<syntaxhighlight lang="bash" enclose="div">
echo "Asia/Tokyo" | sudo tee /etc/timezone
echo "Asia/Tokyo" | sudo tee /etc/timezone
sudo dpkg-reconfigure --frontend noninteractive tzdata
sudo dpkg-reconfigure --frontend noninteractive tzdata
Line 54: Line 59:


TZ に変更により影響のあるサービスを再起動します。
TZ に変更により影響のあるサービスを再起動します。
<syntaxhighlight>
<syntaxhighlight lang="bash" enclose="div">
sudo service rsyslog restart
sudo service rsyslog restart
sudo service cron restart
sudo service cron restart
Line 60: Line 65:


真っ新なインスタンスなので、一度パッケージのアップデートを行います。
真っ新なインスタンスなので、一度パッケージのアップデートを行います。
<syntaxhighlight>
<syntaxhighlight lang="bash" enclose="div">
sudo aptitude update
sudo aptitude update
sudo aptitude -y safe-upgrade
sudo aptitude -y safe-upgrade
Line 68: Line 73:
create volume した EBS を instance に attach して mkfs 、余計なお世話を止めさせる ;) おまじないをした後、
create volume した EBS を instance に attach して mkfs 、余計なお世話を止めさせる ;) おまじないをした後、
/opt に mount しておきます。
/opt に mount しておきます。
<syntaxhighlight>
<syntaxhighlight lang="bash" enclose="div">
sudo mkfs.ext3 /dev/sdf
sudo mkfs.ext3 /dev/sdf
sudo tune2fs -c -1 -i 0 /dev/sdf
sudo tune2fs -c -1 -i 0 /dev/sdf
Line 75: Line 80:


/etc/fstab に EBS ボリュームのマウント情報を書きます。
/etc/fstab に EBS ボリュームのマウント情報を書きます。
/dev/sdf  /opt  ext3    defaults,relatime 0 0
<syntaxhighlight lang="text" enclose="div">
/dev/sdf  /opt  ext3    defaults,relatime 0 0
</syntaxhighlight>


== 内部 DNS ==
== 内部 DNS ==
Line 82: Line 89:
その為に、Zimbra を最初にインストールした際の、"logical hostname" ではプライベートIPアドレスが変わってしまっているので、LDAP サーバが bind できない、という事態に陥ります。
その為に、Zimbra を最初にインストールした際の、"logical hostname" ではプライベートIPアドレスが変わってしまっているので、LDAP サーバが bind できない、という事態に陥ります。
それを避けるために、内部 DNS サーバを立ち上げて、導入時に真の意味での、論理ホスト名になるような "logical hostname" を指定して、インスタンス起動時に割り当てられたプライベートIPアドレスに都度対応できるようにします。
それを避けるために、内部 DNS サーバを立ち上げて、導入時に真の意味での、論理ホスト名になるような "logical hostname" を指定して、インスタンス起動時に割り当てられたプライベートIPアドレスに都度対応できるようにします。
<syntaxhighlight>
<syntaxhighlight lang="bash" enclose="div">
sudo aptitude -y install bind9
sudo aptitude -y install bind9
sudo aptitude install python-ipy
sudo aptitude install python-ipy
Line 97: Line 104:


/etc/hostname に host名 (この場合は aws) を設定します。
/etc/hostname に host名 (この場合は aws) を設定します。
<syntaxhighlight>
<syntaxhighlight lang="bash" enclose="div">
echo "aws" | sudo tee /etc/hostname
echo "aws" | sudo tee /etc/hostname
sudo /bin/hostname -F /etc/hostname
sudo /bin/hostname -F /etc/hostname
</syntaxhighlight>
</syntaxhighlight>


/etc/hosts に、このインスタンスのプライベート IP address, host名, fqdn を設定します。
/etc/hosts に、このインスタンスのプライベート IP address, fqdn, host名を設定します。
<syntaxhighlight>
<syntaxhighlight lang="text" enclose="div">
127.0.0.1 localhost
127.0.0.1 localhost
IPADDRESS aws.example.com aws
IPADDRESS aws.example.com aws
Line 117: Line 124:


正しく host名と fqdn 設定されているかを確認します。
正しく host名と fqdn 設定されているかを確認します。
<syntaxhighlight>
<syntaxhighlight lang="bash" enclose="div">
/bin/hostname
/bin/hostname -s
(host名が返る)
# host名が返る
/bin/hostname -f
/bin/hostname -f
(fqdnが返る)
# fqdnが返る
/bin/hostname -d
/bin/hostname -d
(ドメイン名が返る)
# ドメイン名が返る
</syntaxhighlight>
</syntaxhighlight>


Line 131: Line 138:


ec2-set-hosts
ec2-set-hosts
<syntaxhighlight lang="python" enclose="pre">
<syntaxhighlight lang="python" enclose="div">
#!/usr/bin/python
#!/usr/bin/python
#
#
Line 164: Line 171:
my_hostname = os.popen("/bin/hostname -s").read().rstrip()
my_hostname = os.popen("/bin/hostname -s").read().rstrip()


# replace the ubuntu hostname in /etc/hosts                                                                                
# replace the ubuntu hostname in /etc/hosts
mp = {'localipv4' : my_ip, 'hostname' : my_hostname, 'fqdn' : my_fqdn}
mp = {'localipv4' : my_ip, 'hostname' : my_hostname, 'fqdn' : my_fqdn}
t = Template(file="/usr/local/etc/bind/templates/hosts.tmpl", searchList=[mp])
t = Template(file="/usr/local/etc/bind/templates/hosts.tmpl", searchList=[mp])
Line 174: Line 181:
</syntaxhighlight>
</syntaxhighlight>


 
<syntaxhighlight lang="bash" enclose="div">
<syntaxhighlight>
sudo chmod +x /usr/local/etc/init/ec2-set-hosts
sudo chmod +x /usr/local/etc/init/ec2-set-hosts
</syntaxhighlight>
</syntaxhighlight>


/usr/local/etc/bind/templates/hosts.tmpl
/usr/local/etc/bind/templates/hosts.tmpl
127.0.0.1 localhost
<syntaxhighlight lang="text" enclose="div">
$localipv4 $fqdn $hostname
127.0.0.1 localhost
$localipv4 $fqdn $hostname
# The following lines are desirable for IPv6 capable hosts
 
::1 ip6-localhost ip6-loopback
# The following lines are desirable for IPv6 capable hosts
fe00::0 ip6-localnet
::1 ip6-localhost ip6-loopback
ff00::0 ip6-mcastprefix
fe00::0 ip6-localnet
ff02::1 ip6-allnodes
ff00::0 ip6-mcastprefix
ff02::2 ip6-allrouters
ff02::1 ip6-allnodes
ff02::3 ip6-allhosts
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
</syntaxhighlight>


/usr/local/etc/init に配置して、実行権限を付与します。
/usr/local/etc/init に配置して、実行権限を付与します。
Line 195: Line 203:
ec2-set-dns-zone
ec2-set-dns-zone
(内部 DNS 設定用)
(内部 DNS 設定用)
<syntaxhighlight lang="python">
<syntaxhighlight lang="python" enclose="div">
#!/usr/bin/python
#!/usr/bin/python
#
#
Line 258: Line 266:
</syntaxhighlight>
</syntaxhighlight>


 
<syntaxhighlight lang="bash" enclose="div">
<syntaxhighlight>
sudo chmod +x /usr/local/etc/init/ec2-set-dns-zone
sudo chmod +x /usr/local/etc/init/ec2-set-dns-zone
</syntaxhighlight>
</syntaxhighlight>


/usr/local/etc/bind/templates/zone.tmpl
/usr/local/etc/bind/templates/zone.tmpl
;
<syntaxhighlight lang="text" enclose="div">
; BIND data file for Split DNS
;
;
; BIND data file for Split DNS
@ 604800 IN SOA localhost. root.localhost. (
;
      2 ; Serial
@ 604800 IN SOA localhost. root.localhost. (
604800 ; Refresh
      2 ; Serial
  86400 ; Retry
604800 ; Refresh
2419200 ; Expire
  86400 ; Retry
604800 ) ; Negative Cache TTL
2419200 ; Expire
;
604800 ) ; Negative Cache TTL
@ 604800 IN NS localhost.
;
@ 604800 IN A $localipv4
@ 604800 IN NS localhost.
@ 604800 IN MX 10 @
@ 604800 IN A $localipv4
@ 604800 IN MX 10 @
</syntaxhighlight>


/usr/local/etc/bind/templates/zone.tmpl
/usr/local/etc/bind/templates/zone.tmpl
;
<syntaxhighlight lang="text" enclose="div">
; BIND data file for Split DNS
;
;
; BIND data file for Split DNS
@ 604800 IN SOA localhost. root.localhost. (
;
      2 ; Serial
@ 604800 IN SOA localhost. root.localhost. (
604800 ; Refresh
      2 ; Serial
  86400 ; Retry
604800 ; Refresh
2419200 ; Expire
  86400 ; Retry
604800 ) ; Negative Cache TTL
2419200 ; Expire
;
604800 ) ; Negative Cache TTL
@ 604800 IN NS localhost.
;
@ 604800 IN PTR $fqdn.
@ 604800 IN NS localhost.
@ 604800 IN PTR $fqdn.
</syntaxhighlight>


/usr/local/etc/bind/templates/conf.tmpl
<syntaxhighlight lang="text" enclose="div">
zone "$fqdn" {
type master;
file "/etc/bind/db.myzone";
};


/usr/local/etc/bind/templates/conf.tmpl
zone "$arpa" {
zone "$fqdn" {
type master;
type master;
file "/etc/bind/db.myarpa";
file "/etc/bind/db.myzone";
};
};
</syntaxhighlight>
zone "$arpa" {
type master;
file "/etc/bind/db.myarpa";
};


/etc/bind/named.conf.local に以下を追加する
/etc/bind/named.conf.local に以下を追加する
include "/etc/bind/myzone.conf";
<syntaxhighlight lang="text" enclose="div">
include "/etc/bind/myzone.conf";
</syntaxhighlight>


/etc/bind/named.conf.options の forwarders を EC2 の内部 DNS サーバに設定
/etc/bind/named.conf.options の forwarders を EC2 の内部 DNS サーバに設定
 
<syntaxhighlight lang="text" enclose="div">
        forwarders {
      forwarders {
                172.16.0.23;
              172.16.0.23;
        };
      };
</syntaxhighlight>


/etc/bind/named.conf.options の listen address 制限しておく
/etc/bind/named.conf.options の listen address 制限しておく
        // listen-on-v6 { any; };
<syntaxhighlight lang="text" enclose="div">
        listen-on { 127.0.0.1; };
        // listen-on-v6 { any; };
        listen-on-v6 { ::1; };
        listen-on { 127.0.0.1; };
        listen-on-v6 { ::1; };
</syntaxhighlight>


起動スクリプトとしてリンク
起動スクリプトとしてリンク
<syntaxhighlight>
<syntaxhighlight lang="bash" enclose="div">
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-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
sudo ln -s /usr/local/etc/init/ec2-set-dns-zone /etc/rc2.d/S13ec2-set-dns-zone
Line 325: Line 342:


dhcp client が自動生成する /etc/resolv.conf に反映する為に、/etc/dhcp3/dhclient.conf を修正します。
dhcp client が自動生成する /etc/resolv.conf に反映する為に、/etc/dhcp3/dhclient.conf を修正します。
prepend domain-name-servers 127.0.0.1;
<syntaxhighlight lang="text" enclose="div">
supersede domain-name "example.com";
prepend domain-name-servers 127.0.0.1;
 
supersede domain-name "example.com";
</syntaxhighlight>


ここで一度この script を起動して動作確認します。
ここで一度この script を起動して動作確認します。
<syntaxhighlight>
<syntaxhighlight lang="bash" enclose="div">
sudo /usr/local/etc/init/ec2-set-hosts
sudo /usr/local/etc/init/ec2-set-hosts
cat /etc/hosts
cat /etc/hosts
</syntaxhighlight>
</syntaxhighlight>


 
<syntaxhighlight lang="bash" enclose="div">
<syntaxhighlight>
sudo /usr/local/etc/init/ec2-set-dns-zone
sudo /usr/local/etc/init/ec2-set-dns-zone
sudo /etc/init.d/bind9 restart
sudo /etc/init.d/bind9 restart
Line 346: Line 363:
== パッケージ ==
== パッケージ ==
Zimbra に必要なパッケージを導入します。
Zimbra に必要なパッケージを導入します。
<syntaxhighlight>
<syntaxhighlight lang="bash" enclose="div">
sudo aptitude install libperl5.10
sudo aptitude install libperl5.10
sudo aptitude install sysstat
sudo aptitude install sysstat
Line 354: Line 371:
== セキュリティグループ ==
== セキュリティグループ ==
EC2 の Security Group で Zimbra に必要な port を設定します。
EC2 の Security Group で Zimbra に必要な port を設定します。
SMTP 25
<syntaxhighlight lang="text" enclose="div">
HTTP 80
SMTP 25
HTTPS 443
HTTP 80
IMAP 143
HTTPS 443
IMAP (Secure) 993
IMAP 143
POP3 110
IMAP (Secure) 993
POP3 (Secure) 995
POP3 110
Custom で 7071 (Administration Console)
POP3 (Secure) 995
Custom で 7071 (Administration Console)
</syntaxhighlight>
もちろん、使わないサービスの port は閉じておくべきです。
もちろん、使わないサービスの port は閉じておくべきです。


Line 376: Line 395:
[http://www.zimbra.com/community/downloads.html Zimbra のサイト]から、パッケージを EC2 の EBS ボリュームに持って展開しておきます。
[http://www.zimbra.com/community/downloads.html Zimbra のサイト]から、パッケージを EC2 の EBS ボリュームに持って展開しておきます。


<syntaxhighlight>
<syntaxhighlight lang="bash" enclose="div">
cd /opt
cd /opt
wget http://files2.zimbra.com/downloads/7.1.0_GA/zcs-7.1.0_GA_3140.UBUNTU10_64.20110329151347.tgz
wget http://files2.zimbra.com/downloads/7.1.0_GA/zcs-7.1.0_GA_3140.UBUNTU10_64.20110329151347.tgz
Line 385: Line 404:
== コンフィグレーション ==
== コンフィグレーション ==
Zimbra のパッケージを展開したディレクトリで、
Zimbra のパッケージを展開したディレクトリで、
<syntaxhighlight>
<syntaxhighlight lang="bash" enclose="div">
./install.sh
./install.sh
</syntaxhighlight>
</syntaxhighlight>
Line 391: Line 410:
インストーラーが起動します。
インストーラーが起動します。
'''<RETURN>'''と書いてあるところで入力待ちがあります。
'''<RETURN>'''と書いてあるところで入力待ちがあります。
<pre>
<syntaxhighlight lang="text" enclose="div">
Operations logged to /tmp/install.log.9999
Operations logged to /tmp/install.log.9999
Checking for existing installation...
Checking for existing installation...
Line 516: Line 535:
Main menu
Main menu


   1) Common Configuration:                                                
   1) Common Configuration:
   2) zimbra-ldap:                            Enabled                      
   2) zimbra-ldap:                            Enabled
   3) zimbra-store:                            Enabled                      
   3) zimbra-store:                            Enabled
         +Create Admin User:                    yes                          
         +Create Admin User:                    yes
         +Admin user to create:                admin@aws.example.com        
         +Admin user to create:                admin@aws.example.com
******* +Admin Password                        UNSET                        
******* +Admin Password                        UNSET
         +Anti-virus quarantine user:          virus-quarantine.xxxxxxxxx@aws.example.com
         +Anti-virus quarantine user:          virus-quarantine.xxxxxxxxx@aws.example.com
         +Enable automated spam training:      yes                          
         +Enable automated spam training:      yes
         +Spam training user:                  spam.xxxxxxxxx@aws.example.com  
         +Spam training user:                  spam.xxxxxxxxx@aws.example.com
         +Non-spam(Ham) training user:          ham.xxxxxxxxx@aws.example.com
         +Non-spam(Ham) training user:          ham.xxxxxxxxx@aws.example.com
         +SMTP host:                            aws.example.com              
         +SMTP host:                            aws.example.com
         +Web server HTTP port:                80                          
         +Web server HTTP port:                80
         +Web server HTTPS port:                443                          
         +Web server HTTPS port:                443
         +Web server mode:                      http                        
         +Web server mode:                      http
         +IMAP server port:                    143                          
         +IMAP server port:                    143
         +IMAP server SSL port:                993                          
         +IMAP server SSL port:                993
         +POP server port:                      110                          
         +POP server port:                      110
         +POP server SSL port:                  995                          
         +POP server SSL port:                  995
         +Use spell check server:              yes                          
         +Use spell check server:              yes
         +Spell server URL:                    http://aws.example.com:7780/aspell.php
         +Spell server URL:                    http://aws.example.com:7780/aspell.php
         +Configure for use with mail proxy:    FALSE                        
         +Configure for use with mail proxy:    FALSE
         +Configure for use with web proxy:    FALSE                        
         +Configure for use with web proxy:    FALSE
         +Enable version update checks:        TRUE                        
         +Enable version update checks:        TRUE
         +Enable version update notifications:  TRUE                        
         +Enable version update notifications:  TRUE
         +Version update notification email:    admin@aws.example.com        
         +Version update notification email:    admin@aws.example.com
         +Version update source email:          admin@aws.example.com        
         +Version update source email:          admin@aws.example.com


   4) zimbra-mta:                              Enabled                      
   4) zimbra-mta:                              Enabled
   5) zimbra-snmp:                            Enabled                      
   5) zimbra-snmp:                            Enabled
   6) zimbra-logger:                          Enabled                      
   6) zimbra-logger:                          Enabled
   7) zimbra-spell:                            Enabled                      
   7) zimbra-spell:                            Enabled
   8) Default Class of Service Configuration:                              
   8) Default Class of Service Configuration:
   r) Start servers after configuration        yes                          
   r) Start servers after configuration        yes
   s) Save config to file                                                  
   s) Save config to file
   x) Expand menu                                                          
   x) Expand menu
   q) Quit                                  
   q) Quit


Address unconfigured (**) items  (? - help) 1<RETURN>
Address unconfigured (**) items  (? - help) 1<RETURN>
Line 558: Line 577:
Common configuration
Common configuration


   1) Hostname:                                aws.example.com              
   1) Hostname:                                aws.example.com
   2) Ldap master host:                        aws.example.com              
   2) Ldap master host:                        aws.example.com
   3) Ldap port:                              389                          
   3) Ldap port:                              389
   4) Ldap Admin password:                    set                          
   4) Ldap Admin password:                    set
   5) Secure interprocess communications:      yes                          
   5) Secure interprocess communications:      yes
   6) TimeZone:                                America/Los_Angeles          
   6) TimeZone:                                America/Los_Angeles


Select, or 'r' for previous menu [r] 6<RETURN>
Select, or 'r' for previous menu [r] 6<RETURN>
Line 577: Line 596:
Common configuration
Common configuration


   1) Hostname:                                aws.example.com              
   1) Hostname:                                aws.example.com
   2) Ldap master host:                        aws.example.com              
   2) Ldap master host:                        aws.example.com
   3) Ldap port:                              389                          
   3) Ldap port:                              389
   4) Ldap Admin password:                    set                          
   4) Ldap Admin password:                    set
   5) Secure interprocess communications:      yes                          
   5) Secure interprocess communications:      yes
   6) TimeZone:                                Asia/Tokyo                  
   6) TimeZone:                                Asia/Tokyo


Select, or 'r' for previous menu [r] <RETURN>
Select, or 'r' for previous menu [r] <RETURN>
Line 588: Line 607:
Main menu
Main menu


   1) Common Configuration:                                                
   1) Common Configuration:
   2) zimbra-ldap:                            Enabled                      
   2) zimbra-ldap:                            Enabled
   3) zimbra-store:                            Enabled                      
   3) zimbra-store:                            Enabled
         +Create Admin User:                    yes                          
         +Create Admin User:                    yes
         +Admin user to create:                admin@aws.example.com        
         +Admin user to create:                admin@aws.example.com
******* +Admin Password                        UNSET                        
******* +Admin Password                        UNSET
         +Anti-virus quarantine user:          virus-quarantine.xxxxxxxxx@aws.example.com
         +Anti-virus quarantine user:          virus-quarantine.xxxxxxxxx@aws.example.com
         +Enable automated spam training:      yes                          
         +Enable automated spam training:      yes
         +Spam training user:                  spam.xxxxxxxxx@aws.example.com  
         +Spam training user:                  spam.xxxxxxxxx@aws.example.com
         +Non-spam(Ham) training user:          ham.xxxxxxxxx@aws.example.com
         +Non-spam(Ham) training user:          ham.xxxxxxxxx@aws.example.com
         +SMTP host:                            aws.example.com              
         +SMTP host:                            aws.example.com
         +Web server HTTP port:                80                          
         +Web server HTTP port:                80
         +Web server HTTPS port:                443                          
         +Web server HTTPS port:                443
         +Web server mode:                      http                        
         +Web server mode:                      http
         +IMAP server port:                    143                          
         +IMAP server port:                    143
         +IMAP server SSL port:                993                          
         +IMAP server SSL port:                993
         +POP server port:                      110                          
         +POP server port:                      110
         +POP server SSL port:                  995                          
         +POP server SSL port:                  995
         +Use spell check server:              yes                          
         +Use spell check server:              yes
         +Spell server URL:                    http://aws.example.com:7780/aspell.php
         +Spell server URL:                    http://aws.example.com:7780/aspell.php
         +Configure for use with mail proxy:    FALSE                        
         +Configure for use with mail proxy:    FALSE
         +Configure for use with web proxy:    FALSE                        
         +Configure for use with web proxy:    FALSE
         +Enable version update checks:        TRUE                        
         +Enable version update checks:        TRUE
         +Enable version update notifications:  TRUE                        
         +Enable version update notifications:  TRUE
         +Version update notification email:    admin@aws.example.com        
         +Version update notification email:    admin@aws.example.com
         +Version update source email:          admin@aws.example.com        
         +Version update source email:          admin@aws.example.com


   4) zimbra-mta:                              Enabled                      
   4) zimbra-mta:                              Enabled
   5) zimbra-snmp:                            Enabled                      
   5) zimbra-snmp:                            Enabled
   6) zimbra-logger:                          Enabled                      
   6) zimbra-logger:                          Enabled
   7) zimbra-spell:                            Enabled                      
   7) zimbra-spell:                            Enabled
   8) Default Class of Service Configuration:                              
   8) Default Class of Service Configuration:
   r) Start servers after configuration        yes                          
   r) Start servers after configuration        yes
   s) Save config to file                                                  
   s) Save config to file
   x) Expand menu                                                          
   x) Expand menu
   q) Quit                                  
   q) Quit


Address unconfigured (**) items  (? - help) 3<RETURN>
Address unconfigured (**) items  (? - help) 3<RETURN>
Line 630: Line 649:
Store configuration
Store configuration


   1) Status:                                  Enabled                      
   1) Status:                                  Enabled
   2) Create Admin User:                      yes                          
   2) Create Admin User:                      yes
   3) Admin user to create:                    admin@aws.example.com        
   3) Admin user to create:                    admin@aws.example.com
** 4) Admin Password                          UNSET                        
** 4) Admin Password                          UNSET
   5) Anti-virus quarantine user:              virus-quarantine.xxxxxxxxx@aws.example.com
   5) Anti-virus quarantine user:              virus-quarantine.xxxxxxxxx@aws.example.com
   6) Enable automated spam training:          yes                          
   6) Enable automated spam training:          yes
   7) Spam training user:                      spam.xxxxxxxxx@aws.example.com  
   7) Spam training user:                      spam.xxxxxxxxx@aws.example.com
   8) Non-spam(Ham) training user:            ham.xxxxxxxxx@aws.example.com
   8) Non-spam(Ham) training user:            ham.xxxxxxxxx@aws.example.com
   9) SMTP host:                              aws.example.com              
   9) SMTP host:                              aws.example.com
   10) Web server HTTP port:                    80                          
   10) Web server HTTP port:                    80
   11) Web server HTTPS port:                  443                          
   11) Web server HTTPS port:                  443
   12) Web server mode:                        http                        
   12) Web server mode:                        http
   13) IMAP server port:                        143                          
   13) IMAP server port:                        143
   14) IMAP server SSL port:                    993                          
   14) IMAP server SSL port:                    993
   15) POP server port:                        110                          
   15) POP server port:                        110
   16) POP server SSL port:                    995                          
   16) POP server SSL port:                    995
   17) Use spell check server:                  yes                          
   17) Use spell check server:                  yes
   18) Spell server URL:                        http://aws.example.com:7780/aspell.php
   18) Spell server URL:                        http://aws.example.com:7780/aspell.php
   19) Configure for use with mail proxy:      FALSE                        
   19) Configure for use with mail proxy:      FALSE
   20) Configure for use with web proxy:        FALSE                        
   20) Configure for use with web proxy:        FALSE
   21) Enable version update checks:            TRUE                        
   21) Enable version update checks:            TRUE
   22) Enable version update notifications:    TRUE                        
   22) Enable version update notifications:    TRUE
   23) Version update notification email:      admin@aws.example.com        
   23) Version update notification email:      admin@aws.example.com
   24) Version update source email:            admin@aws.example.com        
   24) Version update source email:            admin@aws.example.com


Select, or 'r' for previous menu [r] 4<RETURN>
Select, or 'r' for previous menu [r] 4<RETURN>
Line 661: Line 680:
Store configuration
Store configuration


   1) Status:                                  Enabled                      
   1) Status:                                  Enabled
   2) Create Admin User:                      yes                          
   2) Create Admin User:                      yes
   3) Admin user to create:                    admin@aws.example.com        
   3) Admin user to create:                    admin@aws.example.com
   4) Admin Password                          set                          
   4) Admin Password                          set
   5) Anti-virus quarantine user:              virus-quarantine.xxxxxxxxx@aws.example.com
   5) Anti-virus quarantine user:              virus-quarantine.xxxxxxxxx@aws.example.com
   6) Enable automated spam training:          yes                          
   6) Enable automated spam training:          yes
   7) Spam training user:                      spam.xxxxxxxxx@aws.example.com  
   7) Spam training user:                      spam.xxxxxxxxx@aws.example.com
   8) Non-spam(Ham) training user:            ham.xxxxxxxxx@aws.example.com
   8) Non-spam(Ham) training user:            ham.xxxxxxxxx@aws.example.com
   9) SMTP host:                              aws.example.com              
   9) SMTP host:                              aws.example.com
   10) Web server HTTP port:                    80                          
   10) Web server HTTP port:                    80
   11) Web server HTTPS port:                  443                          
   11) Web server HTTPS port:                  443
   12) Web server mode:                        http                        
   12) Web server mode:                        http
   13) IMAP server port:                        143                          
   13) IMAP server port:                        143
   14) IMAP server SSL port:                    993                          
   14) IMAP server SSL port:                    993
   15) POP server port:                        110                          
   15) POP server port:                        110
   16) POP server SSL port:                    995                          
   16) POP server SSL port:                    995
   17) Use spell check server:                  yes                          
   17) Use spell check server:                  yes
   18) Spell server URL:                        http://aws.example.com:7780/aspell.php
   18) Spell server URL:                        http://aws.example.com:7780/aspell.php
   19) Configure for use with mail proxy:      FALSE                        
   19) Configure for use with mail proxy:      FALSE
   20) Configure for use with web proxy:        FALSE                        
   20) Configure for use with web proxy:        FALSE
   21) Enable version update checks:            TRUE                        
   21) Enable version update checks:            TRUE
   22) Enable version update notifications:    TRUE                        
   22) Enable version update notifications:    TRUE
   23) Version update notification email:      admin@aws.example.com        
   23) Version update notification email:      admin@aws.example.com
   24) Version update source email:            admin@aws.example.com        
   24) Version update source email:            admin@aws.example.com


Select, or 'r' for previous menu [r] 12<RETURN>
Select, or 'r' for previous menu [r] 12<RETURN>
Line 692: Line 711:
Store configuration
Store configuration


   1) Status:                                  Enabled                      
   1) Status:                                  Enabled
   2) Create Admin User:                      yes                          
   2) Create Admin User:                      yes
   3) Admin user to create:                    admin@aws.example.com        
   3) Admin user to create:                    admin@aws.example.com
   4) Admin Password                          set                          
   4) Admin Password                          set
   5) Anti-virus quarantine user:              virus-quarantine.xxxxxxxxx@aws.example.com
   5) Anti-virus quarantine user:              virus-quarantine.xxxxxxxxx@aws.example.com
   6) Enable automated spam training:          yes                          
   6) Enable automated spam training:          yes
   7) Spam training user:                      spam.xxxxxxxxx@aws.example.com  
   7) Spam training user:                      spam.xxxxxxxxx@aws.example.com
   8) Non-spam(Ham) training user:            ham.xxxxxxxxx@aws.example.com
   8) Non-spam(Ham) training user:            ham.xxxxxxxxx@aws.example.com
   9) SMTP host:                              aws.example.com              
   9) SMTP host:                              aws.example.com
   10) Web server HTTP port:                    80                          
   10) Web server HTTP port:                    80
   11) Web server HTTPS port:                  443                          
   11) Web server HTTPS port:                  443
   12) Web server mode:                        https                        
   12) Web server mode:                        https
   13) IMAP server port:                        143                          
   13) IMAP server port:                        143
   14) IMAP server SSL port:                    993                          
   14) IMAP server SSL port:                    993
   15) POP server port:                        110                          
   15) POP server port:                        110
   16) POP server SSL port:                    995                          
   16) POP server SSL port:                    995
   17) Use spell check server:                  yes                          
   17) Use spell check server:                  yes
   18) Spell server URL:                        http://aws.example.com:7780/aspell.php
   18) Spell server URL:                        http://aws.example.com:7780/aspell.php
   19) Configure for use with mail proxy:      FALSE                        
   19) Configure for use with mail proxy:      FALSE
   20) Configure for use with web proxy:        FALSE                        
   20) Configure for use with web proxy:        FALSE
   21) Enable version update checks:            TRUE                        
   21) Enable version update checks:            TRUE
   22) Enable version update notifications:    TRUE                        
   22) Enable version update notifications:    TRUE
   23) Version update notification email:      admin@aws.example.com        
   23) Version update notification email:      admin@aws.example.com
   24) Version update source email:            admin@aws.example.com        
   24) Version update source email:            admin@aws.example.com


Select, or 'r' for previous menu [r] <RETURN>
Select, or 'r' for previous menu [r] <RETURN>
Line 721: Line 740:
Main menu
Main menu


   1) Common Configuration:                                                
   1) Common Configuration:
   2) zimbra-ldap:                            Enabled                      
   2) zimbra-ldap:                            Enabled
   3) zimbra-store:                            Enabled                      
   3) zimbra-store:                            Enabled
   4) zimbra-mta:                              Enabled                      
   4) zimbra-mta:                              Enabled
   5) zimbra-snmp:                            Enabled                      
   5) zimbra-snmp:                            Enabled
   6) zimbra-logger:                          Enabled                      
   6) zimbra-logger:                          Enabled
   7) zimbra-spell:                            Enabled                      
   7) zimbra-spell:                            Enabled
   8) Default Class of Service Configuration:                              
   8) Default Class of Service Configuration:
   r) Start servers after configuration        yes                          
   r) Start servers after configuration        yes
   s) Save config to file                                                  
   s) Save config to file
   x) Expand menu                                                          
   x) Expand menu
   q) Quit                                  
   q) Quit


*** CONFIGURATION COMPLETE - press 'a' to apply
*** CONFIGURATION COMPLETE - press 'a' to apply
Select from menu, or press 'a' to apply config (? - help) a<RETURN>
Select from menu, or press 'a' to apply config (? - help) a<RETURN>
Save configuration data to a file? [Yes] <RETURN>
Save configuration data to a file? [Yes] <RETURN>
Save config in file: [/opt/zimbra/config.9999]  
Save config in file: [/opt/zimbra/config.9999]
Saving config in /opt/zimbra/config.9999...done.
Saving config in /opt/zimbra/config.9999...done.
The system will be modified - continue? [No] Yes<RETURN>
The system will be modified - continue? [No] Yes<RETURN>
Line 754: Line 773:


Configuration complete - press return to exit <RETURN>
Configuration complete - press return to exit <RETURN>
</pre>
</syntaxhighlight>


Zimbra が正常に稼働しているか確認します。
Zimbra が正常に稼働しているか確認します。
<pre>
<syntaxhighlight lang="text" enclose="div">
root@aws:/opt/zcs-7.1.0_GA_3140.UBUNTU10_64.20110329151347# su - zimbra
root@aws:/opt/zcs-7.1.0_GA_3140.UBUNTU10_64.20110329151347# su - zimbra
zimbra@aws:~$ zmcontrol status
zimbra@aws:~$ zmcontrol status
Line 771: Line 790:
stats                  Running
stats                  Running
zmconfigd              Running
zmconfigd              Running
 
</syntaxhighlight>
</pre>


= Zimbra Administration Console =
= Zimbra Administration Console =
Line 778: Line 796:
Zimbra Administration Console にログインします。
Zimbra Administration Console にログインします。


  <nowiki>https://aws.example.com:7071/</nowiki>
  [https://aws.example.com:7071/ https://aws.example.com:7071/]


証明書は「オレオレ証明書」になっているので、警告が出ますが、継続してください。
証明書は「オレオレ証明書」になっているので、警告が出ますが、継続してください。
Line 795: Line 813:
(これも古い ec2-init から流用して EC2 Instance Metadata から自動設定する script を書きました)
(これも古い ec2-init から流用して EC2 Instance Metadata から自動設定する script を書きました)


<syntaxhighlight lang="python">
<syntaxhighlight lang="python" enclose="div">
#!/usr/bin/python
#!/usr/bin/python
#
#
Line 824: Line 842:
base_url = 'http://169.254.169.254/%s/meta-data' % api_ver
base_url = 'http://169.254.169.254/%s/meta-data' % api_ver
my_ip = urllib.urlopen('%s/local-ipv4/' % base_url).read()
my_ip = urllib.urlopen('%s/local-ipv4/' % base_url).read()
my_fqdn = os.popen("/bin/cat /etc/hostname").read().rstrip()
my_fqdn = os.popen("/bin/hostname -f").read().rstrip()


my_cmd = 'zmprov modifyServer %s zimbraMtaMyNetworks \'127.0.0.0/8 %s/32\'' % (my_fqdn, my_ip,)
my_cmd = 'zmprov modifyServer %s zimbraMtaMyNetworks \'127.0.0.0/8 %s/32\'' % (my_fqdn, my_ip,)
Line 839: Line 857:
= OS からのメールを受け取る =
= OS からのメールを受け取る =
Sending Mail from Terminal (optional)
Sending Mail from Terminal (optional)
<syntaxhighlight>
<syntaxhighlight lang="bash" enclose="div">
wget http://ubuntu.lnix.net/misc/mta-dummy/mta-dummy_1.0_all.deb  
wget http://ubuntu.lnix.net/misc/mta-dummy/mta-dummy_1.0_all.deb  
dpkg -i mta-dummy_1.0_all.deb
dpkg -i mta-dummy_1.0_all.deb
aptitude install bsd-mailx
aptitude install bsd-mailx
Add the following to /etc/mail.rc:
# Add the following to /etc/mail.rc:
  set sendmail=/opt/zimbra/postfix/sbin/sendmail
set sendmail=/opt/zimbra/postfix/sbin/sendmail
</syntaxhighlight>
</syntaxhighlight>