Tuesday, June 26, 2007

zimbra on Debian etch 安装

zimbra 科普

zimbra 是一个集成的协作办公系统,Open Source 版本的提供的功能和构件有:
  • Pop3/IMAP
  • web 界面的管理系统
  • webmail 系统,并支持地址簿,行事历等
  • Apache Tomcat,提供 web 服务器环境
  • Postfix, 发送邮件的 MTA
  • OpenLDAP 提供 LDAP 用户认证
  • MySQL 数据库存储用户账户,用户 webmail 相关数据
  • Lucene,数据索引和搜索
  • Anti-virus,防病毒系统
  • Anti-spam,预防垃圾邮件系统
  • Zimbra Spell 拼写检查

安装

zimbra 当前稳定版本是 4.5,并没有 for debian etch 的二进制包,好在有提供 for debian sarge 的,安装的话需要做一些小手脚:
// quote from http://www.zimbra.com/forums/installation/6443-debian-etch-4-0-install.html#post41225

before you start, *setup your DNS*. Zimbra install is very sensitive to correct DNS setup, particularly /etc/hosts and forward resolution of the hostname you are installing on as returned from hostname. Search wiki/forum for correct DNS setup.

change /etc/debian_version to 3.1
apt-get install sudo curl fetchmail libgmp3c2 libssl0.9.7 libdb3
chmod a+rwx /tmp

tar -xzf 
cd zcs/

clean out previous attempts:
sh install -u
rm -rf /opt/zimbra
rm /tmp/install*
rm /tmp/zmsetup*
rm /tmp/*zim*

change util/utilfunc.sh
if [ $PLATFORM = "UBUNTU6"]; then
to
if [ $PLATFORM = "UBUNTU6" -o $PLATFORM = "DEBIAN3.1" ]; then

sh install.sh

Strangely detects hostname as domainname (never quite understood why it does this). Select 'Yes' for "Change domain name", change to domainname "domain.com" instead of "host.domain.com"

If you haven't set your MX yet, ignore (you'll need to set this later but its fine for install):
DNS ERROR - none of the MX records for ijichi.org
resolve to this host
It is suggested that the MX record resolve to this host
Re-Enter domain name? [Yes]
^^ Choose "No"

Install Menu: Choose 6 for zimbra-store, 4 for Admin Password, enter password, 'r' or  for previous menu, 'a' to apply, Enter for next two questions:
Save configuration data to a file? [Yes]
Save config in file: [/opt/zimbra/config.15938]
Then 'Yes' for: The system will be modified - continue? [No] yes

Checkout output carefully for *any* errors, should install fine.

You can change /etc/debian_version back to 4.0 after install but you'll have to change it for each upgrade
上面所说还是有一些不符的地方,安装脚本名称为 ./install.sh,修改过后按照法安装顺利。 安装之前需要注意端口冲突,先停掉如 apache 等可能端口冲突的程序。

调整

zimbra 提供的包是完整的环境,包括 apache, tomcat, mysql 等。如果系统已经有了 apache 需要做一些调整。如果原有的 web 不需要 https 的支持,完全可以让 zimbra apache 跑在 443,既提高了安全性,又不会和以后系统冲突。
// quote from http://wiki.zimbra.com/index.php?title=ZimbraApache
su - zimbra
zmtlsctl https
tomcat restart
so far so good,直到

问题

实际运行中发现 smtp 无法认证,搜索了一下,发现是认证 URL 没有正确设置到 https 导致,属于 zimbra 4.5 的 BUG。重新设置 zimbraMtaAuthHost 手工修正此问题。
su - zimbra
zmprov ms `zmhostname` zimbraMtaAuthHost mail.example.com

web 管理地址

https://mail.example.com/ 用来访问 webmail https://mail.example.com:7071/ 访问 web 的管理界面。

数据迁移

epaulin 没有数据数据需要迁移,不过这些链接或许对您有用:
  • http://www.zimbra.com/docs/
  • http://www.zimbra.com/community/documentation.html
  • http://wiki.zimbra.com/index.php?title=ZCS_System_Architecture
  • http://wiki.zimbra.com/index.php?title=User_Migration_Articles