接上篇文章
4).Webmail(Extmail+Extman)的架设
Extmail、Extman下载地址:
http://www.extmail.org/download/
Extmail、Extman需要perl-rrdtool、rrdtool以及以下5个Perl模块的支持:
perl-Unix-Syslog 、perl-DBD-MySQL、perl-DBI 、perl-File-Tail、perl-GD
以上7个软件rpm包下载链接
http://packages.sw.be/perl-GD/
http://packages.sw.be/perl-File-Tail/
http://packages.sw.be/perl-Unix-Syslog/
http://packages.sw.be/perl-DBI/
http://packages.sw.be/perl-DBD-MySQL/
http://packages.sw.be/rrdtool/
先检查是否已经安装rpm -qa|grep perl
4.1)安装rpm包:
#rpm -ivh perl-GD-2.44-1.el5.rf.i386.rpm
#rpm -ivhperl-Unix-Syslog-1.1-1.el5.rf.i386.rpm
#rpm -ivh perl-DBI-1.615-1.el5.rfx.i386.rpm
#rpm -ivh perl-DBD-MySQL-4.014-1.el5.rfx.i386.rpm
#rpm -ivh --nodeps perl-rrdtool-1.4.4-1.el5.rf.i386.rpmrrdtool-1.4.4-1.el5.rf.i386.rpm
(安装perl-rrdtool 、rrdtool时会因为缺少依赖包无法安装,因此忽略依赖包强制安装)
其他省略
4.2)将Extmail解包到“/var/www/html/”目录。
#tar zxvf extmail-1.1.1.tar.gz-C/var/www/html/
#cd /var/www/html/
#mv extmail-1.1.1extmail
#chown -R vmail:vmail extmail/cgi/
修改ExtMail的配置文件webmail.cf,修改如下内容
#cd /var/www/html/extmail
#cp webmail.cf.default webmail.cf
#vi webmail.cf
修改下面内容:
SYS_CONFIG = /var/www/html/extmail/
SYS_LANGDIR = /var/www/html/extmail/lang
SYS_TEMPLDIR = /var/www/html/extmail/html
SYS_MAILDIR_BASE =/mailbox(刚才创建的/mailbox目录)
SYS_MYSQL_USER = extmail
SYS_MYSQL_PASS = extmail
SYS_MYSQL_DB = extmail
SYS_MYSQL_HOST =localhost
SYS_MYSQL_SOCKET = /var/lib/mysql/mysql.sock
extmail数据库权限相关设置
先查看是否有相关数据库信息
/usr/local/mysql/bin/mysql –u root -p
mysql> show databases;
mysql> use extmail
mysql> show tables;
然后赋予权限
mysql> grant allprivileges on *.* to 'extmail'@'localhost' identified by 'extmail' with grantoption;
4.3)安装运行ExtMan
修改ExtMan的配置文件webmail.cf,修改如下内容
#cd /usr/local/apache2/htdocs/extman/
#cp docs/mysql_virtual_* /etc/postfix/
#cp webman.cf.default webman.cf
修改以下内容:
SYS_CONFIG = /var/www/html/extman/
SYS_LANGDIR = /var/www/html/extman/lang
SYS_TEMPLDIR = /var/www/html/extman/html
SYS_MAILDIR_BASE =/mailbox
SYS_MYSQL_USER = webman
SYS_MYSQL_PASS = webman
SYS_MYSQL_DB = extmail
SYS_MYSQL_HOST =localhost
SYS_MYSQL_SOCKET = /var/lib/mysql/mysql.sock
SYS_CAPTCHA_ON = 0
(该选项是去掉登录时输入验证码如果需要验证码可以以保持值为1)
修改apache配置文件添加虚拟主机
#vi /etc/httpd/conf/httpd.conf
最后面添加如下内容:
NameVirtualHost *:80
Include conf/vhost_*.conf
并且修改
User vmail
Group vmail
#chown -R vmail.vmail /usr/sbin/suexec
(该步骤很重要)
创建并编辑vhost_extmail.conf
#vi /etc/httpd/conf/vhost_extmail.conf
添加如下内容:
#VirtualHost for ExtMailSolution
<VirtualHost *:80>
ServerName mail.test.com
DocumentRoot /var/www/html/extmail/html/
ScriptAlias /extmail/cgi//var/www/html/extmail/cgi/
Alias /extmail /var/www/html/extmail/html/
ScriptAlias /extman/cgi/ /var/www/html/extman/cgi/
Alias /extman /var/www/html/extman/html/
# Suexec config
SuexecUserGroup vmail vmail
</VirtualHost>
重新启动apache服务
#/service httpd restart
然后执行:
#/var/www/html/extman/daemon/cmdserver –daemon
(如果不执行上面这条进入到extman后台时会显示"系统信息No such file or directory")
7.测试
管理员帐号:用户名:root@extmail.org 密码:extmail*123*
登录后台
Extman
管理用户名:root@extmail.org
密码:extmail*123*
Extmail
用户名:postmaster
密码:extmail
域名:extmail.org
登录之后添加域名:test.com添加两个测试账号test@test.com、test1@test.com
经过测试web收发正常
Foxmail收发正常
8.设置apache 、mysql开机启动
chkconfig --level 2345 httpd on
chkconfig --level 2345 mysqld on
将postfix、dovecot添加到启动项
#vi /etc/rc.d/rc.local在最后面添加以下内容:
/usr/local/dovecot/sbin/dovecot-c /etc/dovecot/dovecot.conf
/usr/sbin/postfix start