2011年2月21日月曜日

Bazaar で Subversion っぽいリポジトリを作る

詳しくはこちら
Bazaarでござ~る。猿でもできる分散バージョン管理“超”入門 (1/4) - @IT

実際好きに作れるけど、馴染んだこの形が楽。

  • /trunk
  • /branges
  • /tags
って感じで切り分けます。

$ bzr new --feature-branches /PATH/TO

これで
  • /trunk
が出来るので後は煮るなり焼くなりすればOK

2011年1月30日日曜日

メールサーバを新しくする実験 【ガラケー対応】

一般的なガラケーのブラウザで使えるWebクライアントを導入する。

【サーバの準備】
CGIの使えるApacheを準備。
ポートの兼ね合い等あって今回は別VMにて構築。
mod_sslもあると安心。
※今回はSSL必須を前提で※


【ダウンロード】
$ wget http://www.ln-lab.net/lunar-night.cache/Software/wm_keitai2.latest.tar.bz2

【ファイルの展開】
$ mkdir k
$ cd k
$ tar ../jxf wm_keitai2_3_8_12.tar.bz2
$ cd ..
$ sudo cp -R k /var/www/html/
$ cd /var/www/html/
$ sudo chown -R apache.apache k

【インストール】
*.cgiのperlのパスを確認
$ sudo rm readme.txt
$ sudo chmod 775 *.cgi
$ sudo chmod 666 conf/wm_keitai_sys.conf
$ sudo chmod 666 conf/wm_keitai_access.conf

【動作確認】
https://***/k/wm_keitai2.cgi
へアクセスし、エラーの無いことを確認。

【初期設定】
https://***/k/wm_keitai_conf.cgi
へアクセス。

管理者のパスワードを設定

  • 認証設定 → 任意のパスワードを指定。



詳細デフォルト設定

  • IMAP送信済みボックス → Sent
  • IMAPゴミ箱ボックス → Trash
  • IMAP草稿ボックス → Draft


ログイン設定

  • ログインモード → 簡易ログイン
  • メールアドレス → 削除

※ メールアドレスのフォーマットを空欄にすると、ログイン時に入力必須。
※ @以降がドメインの場合、 $user@ドメイン名とする??

デフォルト設定

  • デフォルトメールサーバ → Zimbraの動作しているサーバ
  • デフォルトSMTPサーバ → Zimbraの動作しているサーバ:25 ( or 587)
  • Mail overSSL → 〆
  • SMTP StartTLS → 〆
  • デフォルトSMTPタイプ → SMTP認証
  • デフォルトMailServertタイプ → IMAP4


【動作確認2】
https://***/k/wm_keitai2.cgi
へ再度アクセス。

ログイン、メールの送受信等をテスト。

2011年1月29日土曜日

メールサーバを新しくする実験 【mailArchivaの導入】

メールサーバが動き出したところで、メールをアーカイブする仕組みを導入。
導入先はZimbraが可動しているサーバ(別でもOK)

今回は メールアーカイブ MailArchiva を利用させていただきました。

【ダウンロード】
上記サイトから


  • MailArchiva Open Source Edition(本体)
  • 日本語パッケージ

をダウンロードする。


【展開&インストール】
$ tar zxf mailarchiva_server_opensource_linux_v1_9_13.tar.gz
$ cd mailarchiva_dist/
$ sudo ./install.sh

MailArchiva Open Source Edition Install/Upgrade
Copyright (c) 2005-2009 Jamie Angus Band

Thank you for downloading MailArchiva Open Source Edition
This script can be used for upgrade purposes as it will always preserve your settings!

To install/upgrade, please enter your registration details below:
Full Name:
Company Name:
Email Address:
Telephone Number:
No Mailboxes:
Max heap size [256m-2048m]?:
server will use 2048m RAM
Using CATALINA_BASE:   /usr/local/mailarchiva/server/../server
Using CATALINA_HOME:   /usr/local/mailarchiva/server/../server
Using CATALINA_TMPDIR: /usr/local/mailarchiva/server/../server/temp
Using JRE_HOME:       /usr/local/mailarchiva/server/../jre
mailarchiva server is installed and running
web console is accessible at http://localhost:8090/mailarchiva
note: default console login username and password is admin
visit http://knowledge.mailarchiva.com for extra tips!

日本語化するために一度止める
$ sudo /etc/init.d/mailarchiva stop

【日本語化】
※ 詳しくはマニュアル参照 ※
$ unzip mailarchiva_ja_20090608.zip
$ cd mailarchiva_ja_20090608
$ sudo cp application_ja.properties /usr/local/mailarchiva/server/webapps/mailarchiva/WEB-INF/classes/properties/
$ sudo rm -fr /usr/local/mailarchiva/server/webapps/mailarchiva/WEB-INF/classes/org/frontbox
$ sudo rm -fr /usr/local/mailarchiva/server/webapps/mailarchiva/WEB-INF/lib/pdfbox-0.80.jar
$ sudo cp *.jar /usr/local/mailarchiva/server/webapps/mailarchiva/WEB-INF/lib/

【自動起動ON】
$ sudo /sbin/chkconfig mailarchiva on

【初期設定】
ブラウザで
http://****:8090/mailarchiva/signonform.do
へアクセス(初期ID/PASSは admin / admin)

可能なら https 必須とすべき

ログインパスワードの変更
設定 → ログイン
マスターパスワード、デフォルトログインドメインを指定。

インデックスの設定
設定 → 一般 → インデックス設定 →  メールインデキシングにのデフォルトの言語 → 日本語


メール暗号化パスワードの登録
設定 → ボリューム

  1. 暗号化パスワードを指定して保存
  2. 新しいボリュームを作成して保存。



【Zimbraとの連携】
もともとZimbraの設定があるみたいなんだけど、Postfix向け設定を使ってます。
$ sudo vi /opt/zimbra/postfix/conf/main.cf
milter_default_action = tempfail
smtpd_milters = inet:127.0.0.1:8092
$ sudo /etc/init.d/zimbra restart

テストメールを送受信し、mailArchiva側に来ているかを確認する。

メールサーバを新しくする実験 【Zimbraを設定する その2】

【事前情報】

  • 管理画面URL: https://***:7071/zimbraAdmin/
  • Webクライアント: https://***/


【外部LDAPサーバとの連携】
管理画面へログイン。
設定 → ドメイン → 対象のドメイン → 認証
へ移動。

認証機構が内部であることを確認。

メニューより認証を設定を選択。


設定その1

  • 認証機構:外部LDAP
  • LDAPサーバ名: ldap://*** : 389
  • SSL/StartTLS は任意
  • LDAPフィルタ:uid=%u
  • LDAP検索ベース:ou=People,dc=examble,dc=com など
  • [次へ]



設定その2

  • 何も変更しない
  • [次へ]



設定その3

  • 任意の情報で接続テスト
  • [テスト]


【自己証明書を使っている場合】
Zimbraは自己証明書を嫌うらしい。
LDAPサーバ側でエクスポート → Zimbra側でインポート
でOK

[OpenDS側]
$ keytool --list -keystore /opt/OpenDS/config/keystore

キーストアのパスワードを入力してください:

***************** 警告 警告 警告 *****************
* キーストアに保存された情報の完全性は検証されて *
* いません! 完全性を検証するには、キーストアの *
* パスワードを入力する必要があります。 *
***************** 警告 警告 警告 *****************

キーストアのタイプ: JKS
キーストアのプロバイダ: SUN

キーストアには 1 エントリが含まれます。

server-cert, 2011/01/14, PrivateKeyEntry,
証明書のフィンガープリント (MD5):

$ keytool -export -alias server-cert -file ./ods.txt -keystore /opt/OpenDS/config/keystore
キーストアのパスワードを入力してください:

***************** 警告 警告 警告 *****************
* キーストアに保存された情報の完全性は検証されて *
* いません! 完全性を検証するには、キーストアの *
* パスワードを入力する必要があります。 *
***************** 警告 警告 警告 *****************

証明書がファイル <./ods.txt> に保存されました。
ファイルをどうにかこうにかZimbra側へコピー

[Zimbra側]
$ sudo /opt/zimbra/java/bin/keytool -import -alias OpenDS -keystore /opt/zimbra/java/jre/lib/security/cacerts -file ./src/ods.txt
キーストアのパスワードを入力してください:
所有者: CN=dns.***, O=OpenDS Self-Signed Certificate
発行者: CN=dns.***, O=OpenDS Self-Signed Certificate
シリアル番号: 4d2fc8d0
有効期間の開始日: Fri Jan 14 12:53:52 JST 2011 終了日: Sun Jan 13 12:53:52 JST 2013
証明書のフィンガープリント:
MD5:
SHA1:
署名アルゴリズム名: SHA1withRSA
バージョン: 3
この証明書を信頼しますか? [no]: yes
証明書がキーストアに追加されました。

その後、Zimbraを再起動


【再度テスト】
再度、LDAPの接続テストを行う。
うまく行けば、OpenDS<->Zimbra連携の成功。
認証を外部のLDAPサーバにお任せ出来るようになる。


【その後】
この時点で通信の暗号化や送信時の認証はほとんど完了しているので非常にらくちん

メールサーバを新しくする実験 【Zimbraを設定する その1】

最初にやっておきたい設定集

すべてコントロールパネルから
※場合によっては反映にサーバの再起動が必要っぽいので注意※

  • グローバル設定 → POP → POP3サービスを有効にする → オフ(IMAP4前提なので
  • ドメイン → 任意のドメイン → タイムゾーン → GMT+9:00
  • 提供サービス → default → 機能 → 任意で
  • 提供サービス → default → プリファレンス → 言語 → 日本語
  • 提供サービス → default → プリファレンス → メール作成/解析用のデフォルトの文字セット → ISO-2022-JP

メールサーバを新しくする実験 【Zimbraをインストールする】

【基本的なポリシー】

  1. 専用のサーバを1台用意してそこに環境を構築する。(機能を分散させようとして挫折済み orz)
  2. ユーザ認証は別途構築したOpenDSを使用。

【OSの準備】
極力シンプルな構成でひとつ。

【下準備】
sudo yum -y install sysstat
sudo /sbin/chkconfig sendmail off
sudo /etc/init.d/sendmail stop
あと、/etc/hosts の変更が必要
127.0.0.1 localhost.localdomain localhost
IPADDRESS FQDN
のみにしておかないと怒られる模様。

【Zimbraのインストール】
Zimbra公式サイトより、OpenSource Editionをゲット
$ tar zxf zcs-6.0.10_GA_2692.RHEL5.20101215171125.tgz
$ cd zcs-6.0.10_GA_2692.RHEL5.20101215171125
$ sudo ./install.sh --platform-override
Operations logged to /tmp/install.log.12226
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

Checking for prerequisites...
     FOUND: NPTL
     FOUND: sudo-1.7.2p1-9
     FOUND: libidn-0.6.5-1.1
     FOUND: gmp-4.1.4-10
     FOUND: /usr/lib/libstdc++.so.6
Checking for suggested prerequisites...
    FOUND: perl-5.8.8
    FOUND: sysstat
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]

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

You appear to be installing packages on a platform different
than the platform for which they were built.

This platform is CentOS5
Packages found: RHEL5
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.


Install anyway? [N] y

The system will be modified.  Continue? [N] y

インストール実行
Removing /opt/zimbra
Removing zimbra crontab entry...done.
done.
Cleaning up zimbra init scripts...done.
Cleaning up /etc/ld.so.conf...done.
Cleaning up /etc/prelink.conf...done.
Cleaning up /etc/security/limits.conf...done.

Finished removing Zimbra Collaboration Suite.

Installing packages

    zimbra-core......zimbra-core-6.0.10_GA_2692.RHEL5-20101215171125.i386.rpm...done
    zimbra-ldap......zimbra-ldap-6.0.10_GA_2692.RHEL5-20101215171125.i386.rpm...done
    zimbra-logger......zimbra-logger-6.0.10_GA_2692.RHEL5-20101215171125.i386.rpm...done
    zimbra-mta......zimbra-mta-6.0.10_GA_2692.RHEL5-20101215171125.i386.rpm...done
    zimbra-snmp......zimbra-snmp-6.0.10_GA_2692.RHEL5-20101215171125.i386.rpm...done
    zimbra-store......zimbra-store-6.0.10_GA_2692.RHEL5-20101215171125.i386.rpm...done
    zimbra-apache......zimbra-apache-6.0.10_GA_2692.RHEL5-20101215171125.i386.rpm...done
    zimbra-spell......zimbra-spell-6.0.10_GA_2692.RHEL5-20101215171125.i386.rpm...done
Operations logged to /tmp/zmsetup.01292011-101137.log
Installing LDAP configuration database...done.
Setting defaults...

DNSの設定にしたがってドメイン名の調整
DNS ERROR resolving MX for ***
It is suggested that the domain name have an MX record configured in DNS
Change domain name? [Yes]
Create domain: [mail.***] ****

初期設定
Main menu

   1) Common Configuration:                                                
   2) zimbra-ldap:                             Enabled                    
   3) zimbra-store:                            Enabled                    
        +Create Admin User:                    yes                        
        +Admin user to create:                 admin@***
******* +Admin Password                        UNSET                      
        +Enable automated spam training:       yes                        
        +Spam training user:                   spam.1zxhho6z@***
        +Non-spam(Ham) training user:          ham.w7u0j8yn@***
        +Global Documents Account:             wiki@***
        +SMTP host:                            mail.***
        +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://mail.***: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@***
        +Version update source email:          admin@***

   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)

最初に変更すべきは

  • タイムゾーン
  • 管理者パスワード
  • Web Server Mode



タイムゾーンの変更
Address unconfigured (**) items  (? - help) 1

Common configuration

   1) Hostname:                                ***
   2) Ldap master host:                        ***
   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

Enter the number for the local timezone: [23] 60

Common configuration

   1) Hostname:                                mail.***              
   2) Ldap master host:                        mail.***              
   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] r

管理者パスワードのセット
Main menu

   1) Common Configuration:                                                
   2) zimbra-ldap:                             Enabled                    
   3) zimbra-store:                            Enabled                    
        +Create Admin User:                    yes                        
        +Admin user to create:                 admin@***            
******* +Admin Password                        UNSET                      
        +Enable automated spam training:       yes                        
        +Spam training user:                   spam.1zxhho6z@***    
        +Non-spam(Ham) training user:          ham.w7u0j8yn@***      
        +Global Documents Account:             wiki@***              
        +SMTP host:                            mail.***              
        +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://mail.***: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@***            
        +Version update source email:          admin@***            

   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

Store configuration

   1) Status:                                  Enabled                    
   2) Create Admin User:                       yes                        
   3) Admin user to create:                    admin@***            
** 4) Admin Password                           UNSET                      
   5) Enable automated spam training:          yes                        
   6) Spam training user:                      spam.1zxhho6z@***    
   7) Non-spam(Ham) training user:             ham.w7u0j8yn@***      
   8) Global Documents Account:                wiki@***              
   9) SMTP host:                               mail.***              
  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://mail.***: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@***            
  24) Version update source email:             admin@***            

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

Password for admin@*** (min 6 characters): [QSo08rdy] ****

Store configuration

   1) Status:                                  Enabled                    
   2) Create Admin User:                       yes                        
   3) Admin user to create:                    admin@***            
   4) Admin Password                           set                        
   5) Enable automated spam training:          yes                        
   6) Spam training user:                      spam.1zxhho6z@***    
   7) Non-spam(Ham) training user:             ham.w7u0j8yn@***      
   8) Global Documents Account:                wiki@***              
   9) SMTP host:                               mail.***              
  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://mail.***: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@***            
  24) Version update source email:             admin@***            

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

Web Server Modeの変更
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)  3


Store configuration

   1) Status:                                  Enabled                    
   2) Create Admin User:                       yes                        
   3) Admin user to create:                    admin@***            
   4) Admin Password                           set                        
   5) Enable automated spam training:          yes                        
   6) Spam training user:                      spam.1zxhho6z@***    
   7) Non-spam(Ham) training user:             ham.w7u0j8yn@***      
   8) Global Documents Account:                wiki@***              
   9) SMTP host:                               mail.***              
  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://mail.***: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@***            
  24) Version update source email:             admin@***            

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

Please enter the web server mode (http,https,both,mixed,redirect) [http] https

Store configuration

   1) Status:                                  Enabled                    
   2) Create Admin User:                       yes                        
   3) Admin user to create:                    admin@***            
   4) Admin Password                           set                        
   5) Enable automated spam training:          yes                        
   6) Spam training user:                      spam.1zxhho6z@***    
   7) Non-spam(Ham) training user:             ham.w7u0j8yn@***      
   8) Global Documents Account:                wiki@***              
   9) SMTP host:                               mail.***              
  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://mail.***: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@***            
  24) Version update source email:             admin@***            

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

先に進む
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
Save configuration data to a file? [Yes]
Save config in file: [/opt/zimbra/config.10053]
Saving config in /opt/zimbra/config.10053...done.
The system will be modified - continue? [No] yes
Operations logged to /tmp/zmsetup.01292011-101951.log
Setting local config values...done.
Setting up CA...done.
Deploying CA to /opt/zimbra/conf/ca ...done.
Creating SSL certificate...done.
Installing mailboxd SSL certificates...done.
Initializing ldap...done.
Setting replication password...done.
Setting Postfix password...done.
Setting amavis password...done.
Setting nginx password...done.
Creating server entry for mail.***...done.
Saving CA in ldap ...done.
Saving SSL Certificate in ldap ...done.
Setting spell check URL...done.
Setting service ports on mail.***...done.
Adding mail.*** to zimbraMailHostPool in default COS...done.
Installing webclient skins...
        pebble...done.
        oasis...done.
        beach...done.
        hotrod...done.
        smoke...done.
        lavender...done.
        waves...done.
        twilight...done.
        steel...done.
        sky...done.
        bare...done.
        sand...done.
        lemongrass...done.
        tree...done.
        zmail...done.
        bones...done.
        lake...done.
        yahoo...done.
Finished installing webclient skins.
Setting zimbraFeatureIMEnabled=FALSE...done.
Setting zimbraFeatureTasksEnabled=TRUE...done.
Setting zimbraFeatureBriefcasesEnabled=TRUE...done.
Setting zimbraFeatureNotebookEnabled=TRUE...done.
Setting MTA auth host...done.
Setting TimeZone Preference...done.
Initializing mta config...done.
Setting services on mail.***...done.
Creating domain ***...done.
Setting default domain name...done.
Creating domain ***...already exists.
Creating admin account admin@***...done.
Creating root alias...done.
Creating postmaster alias...done.
Creating user wiki@***...done.
Creating user spam.1zxhho6z@***...done.
Creating user ham.w7u0j8yn@***...done.
Setting spam training accounts...done.
Initializing store sql database...done.
Setting zimbraSmtpHostname for mail.***...done.
Configuring SNMP...done.
Checking for default IM conference room...not present.
Initializing default IM conference room...done.
Setting up syslog.conf...done.

通知はお好みで
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 (6.0.10_GA_2692_CentOS5)
        The ADMIN EMAIL ADDRESS created (admin@***)

Notify Zimbra of your installation? [Yes] no
Notification skipped
Starting servers...done.
Installing common zimlets...
        com_zimbra_date...done.
        com_zimbra_ymemoticons...done.
        com_zimbra_cert_manager...done.
        com_zimbra_url...done.
        com_zimbra_dnd...done.
        com_zimbra_bulkprovision...done.
        com_zimbra_phone...done.
        com_zimbra_adminversioncheck...done.
        com_zimbra_email...done.
Finished installing common zimlets.
Initializing Documents...done.
Restarting mailboxd...done.
Setting up zimbra crontab...done.


Moving /tmp/zmsetup.01292011-101951.log to /opt/zimbra/log


Configuration complete - press return to exit


ここまでで初期状態で起動してます。

メールサーバを新しくする実験 【LDAPサーバを建てる】

まずはbindとOpenDSを使ってDNSサーバとLDAPサーバを作る。
OpenDSは、SSL/TLSともに有効。証明書はとりあえずテスト用。

【bindの設定】
bindの準備は苦手です(;^ω^)
こんな感じのレコードを作成、詳しくは省略

  • 192.168.5.10:dns.
  • 192.168.5.20:mail.
  • 192.168.5.30:www.


【Javaの導入】
Javaが動く環境が必要なので本家から最新版を持ってくる。
この辺も省略
JAVA_HOMEを設定したり、PATHを設定したり。


【OpenDSの展開】
本当は非rootで動かした方が良いんだろうけどめんd、今回の目的はLDAPサーバを作ることじゃ無いのでその辺はわりと適当。
公式サイトから最新版のアーカイブを落として来て展開するだけ~。

$ unzip OpenDS-2.2.1.zip
$ sudo mv OpenDS-2.2.1 /opt/OpenDS
$ cd /opt/
$ sudo chown -R root.root OpenDS
こんな感じで終了。


【OpenDSのインストール】
$ sudo su -
# cd /opt/OpenDS/
# ./setup  --cli
Please set OPENDS_JAVA_HOME to the root of a Java 5 (or later) installation or edit the java.properties file and then run the dsjavaproperties script to specify the Java version to be used
Oh... orz

$ sudo su -
# export OPENDS_JAVA_HOME=/usr/local/JavaSE
一般的な JAVA_HOME は使わないらしいです。

# ./setup --cli
ディレクトリサーバーの初期ルートユーザー DN として使用するものを指定してください。 [cn=Directory Manager]:
初期ルートユーザーに使用するパスワードを指定してください:
確認のためにパスワードをもう一度入力してください:
ディレクトリサーバーが LDAP クライアントからの接続を受け入れるポートを指定してください。 [389]:

管理コネクタはどのポートで接続を受け入れますか ? [4444]:

ディレクトリデータのベース DN として使用するものを指定してください。 [dc=example,dc=com]:
データベース生成用のオプション:
   1)  ベースエントリのみを作成します
   2)  データベースを空のままにします
   3)  LDIF ファイルからデータをインポートします
   4)  自動生成されたサンプルデータを読み込みます
選択肢 [1]:  1

SSL を有効にしますか ? (yes / no) [no]:  yes
証明書サーバーのオプション:

   1)  自己署名付き証明書を生成します (テスト目的のみでの使用を推奨)
   2)  Java 鍵ストア (JKS) に存在する既存の証明書を使用します
   3)  JCEKS 鍵ストアに存在する既存の証明書を使用します
   4)  PKCS#12 鍵ストアに存在する既存の証明書を使用します
   5)  PKCS#11 トークン上の既存の証明書を使用します

選択肢 [1]:  1

構成の完了時にサーバーを起動しますか ? (yes / no) [yes]:  yes


設定の概要
=============
LDAP リスナーポート:   389
管理コネクタポート:      4444
LDAP セキュアアクセス:  StartTLS を有効にする
       LDAP ポート 636 で SSL を有効にする
       自己署名付き証明書の新規作成
ルートユーザー DN:     cn=Directory Manager
ディレクトリデータ:      新しいベース DN dc=example,dc=com を作成します。
       ベース DN データ: ベースエントリのみを作成する (dc=example,dc=com)

構成の完了時にサーバーを起動します


何を実行しますか ?
   1)  上記のパラメータを使ってサーバーを設定する
   2)  設定パラメータを再度指定する
   3)  設定を取り消す

選択肢 [1]:  1

ディレクトリサーバーを構成しています ..... 完了。
証明書を構成しています ..... 完了。
ベースエントリ dc=example,dc=com を作成しています ..... 完了。
ディレクトリサーバーを起動しています ......... 完了。

この操作の詳細なログについては /tmp/opends-setup-1702124262181786369.log を参照してください。

基本的なサーバー構成状態および構成を表示する場合は、/opt/OpenDS/bin/status を起動できます

これでおしまい
とても簡単。

【OpenDSの初期設定】
実は初期状態だと暗号化パスワードが使えないっぽいです。
なので、そいつを修正

# cd /opt/OpenDS/
# bin/dsconfig --advanced -p 4444 -h localhost -D "cn=directory manager" -X

>>>> OpenDS LDAP 接続パラメータを指定します

ユーザー 'cn=directory manager' のパスワード:

>>>> OpenDS 構成コンソールのメインメニュー

何を構成しますか ?

1) SASL 機構ハンドラ 23) ルート DSE バックエンド
2) アイデンティティーマッパー 24) レプリケーションサーバー
3) アカウントステータス通知ハンドラ 25) レプリケーションドメイン
4) アクセス制御ハンドラ 26) ログパブリッシャー
5) アラートハンドラ 27) ログローテーションポリシー
6) エントリキャッシュ 28) ログ保持ポリシー
7) グループ実装 29) ローカル DB VLV インデックス
8) グローバル構成 30) ローカル DB インデックス
9) デバッグターゲット 31) ワークキュー
10) トラストマネージャープロバイダ 32) ワークフロー
11) ネットワークグループ 33) ワークフロー要素
12) ネットワークグループの QOS ポリシー 34) 仮想属性
13) バックエンド 35) 同期プロバイダ
14) パスワード ポリシー 36) 属性構文
15) パスワードジェネレータ 37) 拡張処理ハンドラ
16) パスワードバリデータ 38) 拡張機能
17) パスワード保存スキーマ 39) 接続ハンドラ
18) プラグイン 40) 暗号化マネージャー
19) プラグインルート 41) 管理コネクタ
20) マッチングルール 42) 証明書マッパー
21) モニタープロバイダ 43) 鍵マネージャープロバイダ
22) ルート DN

q) 終了

選択肢: 14

>>>> パスワード ポリシー 管理メニュー

何を実行しますか ?

1) 既存の パスワードポリシー を一覧表示します
2) 新規 パスワード ポリシー を作成します
3) 既存の パスワード ポリシー を表示および編集します
4) 既存の パスワード ポリシー を削除します

b) 戻る
q) 終了

選択肢 [b]: 3

>>>> 次のリストから パスワード ポリシー を選択します:

1) Default Password Policy
2) Root Password Policy

c) 取消し
q) 終了

選択肢 [c]: 1

>>>> パスワード ポリシー のプロパティーを構成します

プロパティー 値
--------------------------------------------------------------------
1) account-status-notification-handler -
2) allow-expired-password-changes false
3) allow-multiple-password-values false
4) allow-pre-encoded-passwords false
5) allow-user-password-changes true
6) default-password-storage-scheme Salted SHA-1
7) deprecated-password-storage-scheme -
8) expire-passwords-without-warning false
9) force-change-on-add false
10) force-change-on-reset false
11) grace-login-count 0
12) idle-lockout-interval 0 s
13) last-login-time-attribute -
14) last-login-time-format -
15) lockout-duration 0 s
16) lockout-failure-count 0
17) lockout-failure-expiration-interval 0 s
18) max-password-age 0 s
19) max-password-reset-age 0 s
20) min-password-age 0 s
21) password-attribute userpassword
22) password-change-requires-current-password false
23) password-expiration-warning-interval 5 d
24) password-generator Random Password Generator
25) password-history-count 0
26) password-history-duration 0 s
27) password-validator -
28) previous-last-login-time-format -
29) require-change-by-time -
30) require-secure-authentication false
31) require-secure-password-changes false
32) skip-validation-for-administrators false
33) state-update-failure-policy reactive

?) ヘルプ
f) 完了 - すべての変更を パスワード ポリシー に適用します
c) 取消し
q) 終了

選択肢 [f]: 4

>>>> "allow-pre-encoded-passwords" プロパティーを構成しています

ユーザーが事前にエンコードされた値を指定することによってパスワードを変更できるかどうかを示します。

この場合、平文パスワードが不明であるために妥当性検査を適用できないため、セキュリティー上の危険にさらされる可能性があります。

"allow-pre-encoded-passwords" プロパティーを変更しますか ?

1) デフォルト値を維持します: false
2) これを次の値に変更します: true

?) ヘルプ
q) 終了

選択肢 [1]: 2

あとは保存して戻っていくだけ。


【OpenDSの起動】
Redhat的な感じで。
/etc/init.d/opendsあたりに

#!/bin/sh
#
# Startup script for the Open Directory Server
#
# chkconfig: - 85 15
# description: This script starts your OpenDS server

# Source function library.
. /etc/rc.d/init.d/functions

opends=/opt/OpenDS

RETVAL=0

# See how we were called.
case "$1" in
start)
echo -n "Starting OpenDS: "
$opends/bin/start-ds
RETVAL=$?
echo
;;
stop)
echo -n "Shutting down OpenDS: "
$opends/bin/stop-ds
RETVAL=$?
echo
;;
status)
$opends/bin/status
RETVAL=$?
;;
restart)
$opends/bin/stop-ds --restart
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac

exit $RETVAL
を作成しておいて

$ sudo /sbin/chkconfig opends on
でOK。


ここまで来れば、あとはApache Directory Studioあたりを使ってGUIで操作できるはず。

2011年1月24日月曜日

メールサーバを新しくする実験 【いきなりおまけ】

全部のVMを起動した際のリソースの使用状況はこんな感じ


64bitOSばんざい! ヽ(゚∀゚)ノ

メールサーバを新しくする実験 【前提】

新たに色々やってみたので実験記録として残す。
つーかい覚えておけない('A`)



【目標】
  1. 今時のメールサーバを作りたい!!
  2. めんどいので認証はLDAPで
  3. IMAP4対応
  4. 送受信は暗号化
  5. 送信時にも認証(SMTP Auth)
  6. 外部からはWebクライアントを使いたい
  7. ガラケーも見捨てない
  8. 送受信のメールはすべてアーカイブしたい

【使用したプロダクト】

【構成(すべて仮想マシンで実現)
  • ゲートウェイ x 1 (Endian UTM 2.4.1)
  • DNS&LDAPサーバ x 1 (bind & OpenDS on CentOS 5.5)
  • Zimbra(メール)サーバ x 1 (Zimbra on CentOS 5.5)
  • Webサーバ x 1 (Apache 2.2 on CentOS 5.5)
  • クライアント x 1(Ubuntu 10.10)


いつものように Endian UTM をゲートウェイにして、Orange内にサーバ群/Green内にクライアント(Ubuntu)を配置。RED側はVMWare的にNATとして外側への依存は極力回避。
# おかげで外への配信はテスト出来て無いけどな ;(

今回OpenDSを使ったのは単なる興味(;´∀`)
OpenLDAPがいまいちめんどかったってのもあるけど

続く...

2011年1月5日水曜日

9セルバッテリー買いました。

年末年始の話

Thinkpad X200に最初から搭載されている4セルバッテリーの稼働時間が微妙に心許ないので思い切って購入。
まぁ本当のところはレノボ秘密クラブで周辺機器半額セールやってたからなんですけどね!!

バッテリー1本なのに納期まで10日とかいう今時無いよねー的納期を乗り越え装着。




これだけあれば余程のことが無い限り大丈夫でしょうヽ(゚∀゚)ノ






増えた重量?知らんな!!

2011年1月1日土曜日

あけました

あけましておめでとうございます。

今年もこれと言った方向性を定めず
のんびりまったりやって行こうと思います。