POSTFIX邮局系统搭建全过程 (四)

9、  安装配置ExtmailExtman  

(1)       安装和配置Extmail

# tar -zxvf extmail-1.2.tar.gz

# mkdir /var/www/extsuite

# mv extmail-1.2  /var/www/extsuite/extmail

# cd /var/www/extsuite/extmail/

# cp webmail.cf.default webmail.cf

# vi webmail.cf

部分修改选项的说明:

 

SYS_USER_LANG = en_US

语言选项,可改作:

SYS_USER_LANG = zh_CN

 

SYS_MAILDIR_BASE = /home/domains

此处即为您在前文所设置的用户邮件的存放目录,可改作:

SYS_MAILDIR_BASE = /var/mailbox

 

SYS_MYSQL_USER = db_user

SYS_MYSQL_PASS = db_pass

以上两句句用来设置连接数据库服务器所使用用户名、密码和邮件服务器用到的数据库,这里修改为:

SYS_MYSQL_USER = extmail

SYS_MYSQL_PASS = extmail

 

 

SYS_MYSQL_HOST = localhost

指明数据库服务器主机名,这里默认即可

 

SYS_MYSQL_SOCKET = /var/lib/mysql/mysql.sock

连接数据库的sock文件位置,这里修改为:

SYS_MYSQL_SOCKET = /tmp/mysql.sock

 

 

SYS_MYSQL_TABLE = mailbox

SYS_MYSQL_ATTR_USERNAME = username

SYS_MYSQL_ATTR_DOMAIN = domain

SYS_MYSQL_ATTR_PASSWD = password

以上用来指定验正用户登录里所用到的表,以及用户名、域名和用户密码分别对应的表中列的名称;这里默认即可

 

SYS_AUTHLIB_SOCKET = /var/spool/authdaemon/socket

此句用来指明authdaemo socket文件的位置,这里修改为:

SYS_AUTHLIB_SOCKET = /usr/local/courier-authlib/var/spool/authdaemon/socket

 

修改 cgi执行文件属主为apache运行身份用户:

# chown -R vmail.vmail /var/www/extsuite/extmail/cgi/

(2)       安装配置Extman

                   # mv extman-1.1  /var/www/extsuite/extman

                   #cd  /var/www/extsuite/extman

                   # mv webman.cf.default webman.cf

修改配置文件以符合本例的需要:

# vi /var/www/extsuite/extman/webman.cf

 

SYS_MAILDIR_BASE = /home/domains

此处即为您在前文所设置的用户邮件的存放目录,可改作:

SYS_MAILDIR_BASE = /var/mailbox

 

SYS_MYSQL_SOCKET = /var/lib/mysql/mysql.sock

此处修改为:

SYS_MYSQL_SOCKET = /tmp/mysql.sock

(3)       使用extman源码目录下docs目录中的extmail.sqlinit.sql建立数据库:

# cd /var/www/extsuite/extman

# mysql -u root -p <docs/extmail.sql

# mysql -u root -p <docs/init.sql

(4)       修改cgi目录的属主:

chown -R vmail.vmail /var/www/extsuite/extman/cgi

(5)       extmanextmail需要Perl-Unix-SyslogDBD-Mysqlperl-GD的支持

#perl -MCPAN -e  shell

然后一路回车后出现:

cpan>

然后我们输入:

cpan>install Unix::Syslog

cpan>install GD

cpan>install DBI

-----cpan>install DBD::mysql # DBD-Mysql目前最新的版本为DBD-mysql-4.006,但它和系统中的perl结合使用时会造成extmail无法正常使用,因此我们采用 3的版本

# tar -zxvf DBD-mysql-3.0008_1.tar.gz

# cd DBD-mysql-3.0008_1  

# perl Makefile.PL

# make

# make install

(6)       建立extmanextmail的目录

# mkdir /tmp/extman

# chown -R vmail.vmail /tmp/extman/

# mkdir /tmp/extmail

# chown -R vmail.vmail /tmp/extmail/

(7)       apache相关配置

# vi /usr/local/apache2/conf/httpd.conf

去掉这行前面的#

Include conf/extra/httpd-vhosts.conf

 

# vi /usr/local/apache2/conf/extra/httpd-vhosts.conf

去后面的<VirtualHost>两段

<VirtualHost *:80>

....

</VirtualHost>

添加下面内容

<VirtualHost *:80>

ServerName mail.xxt.cn

DocumentRoot /var/www/extsuite/

ScriptAlias /extmail/cgi/ /var/www/extsuite/extmail/cgi/

Alias /extmail/ /var/www/extsuite/extmail/html/

ScriptAlias /extman/cgi/ /var/www/extsuite/extman/cgi/

Alias /extman/ /var/www/extsuite/extman/html/

SuexecUserGroup vmail vmail

</VirtualHost>

(8)       重启一下apache服务器

#service httpd restart

到此,就全配置完了

在浏览器中输入http://mail.xxt.cn/extman进入管理界面,默认内置账号是[email protected],密码是 extmail*123*,添加一个域和用户

http://mail.xxt.cn/extmail中登陆

 

第二篇:图像化日志安装

 

10、              安装图形化日志

(1)       安装gd-2.0.35

# tar -jxvf gd-2.0.35.tar.bz2

# cd gd-2.0.35

# ./configure --with-png --with-freetype --with-jpeg --with-zlib --with-fontconfig

# make

如果GD报错:configure.ac:64: warning: macro `AM_ICONV' not found in library你就make clean一下,然后再make

如果你安装别的出现libtool没有找到,你就从/usr/bin/libtool cp 一个过来用就好了!

# make install

(2)       安装Time-HiRes

# tar -zxvf Time-HiRes-1.9719.tar.gz

# cd Time-HiRes-1.9719

# perl Makefile.PL

# make

# make test

# make install

(3)       安装File-Tail

# tar -zxvf File-Tail-0.99.3.tar.gz

# cd File-Tail-0.99.3

# perl Makefile.PL

# make

# make test

# make install

(4)       安装rrdtool(用最新版的编译没通过)

#yum install tcl-devel

#yum install libpng

# yum install freetype

# yum install  libart_lgpl-devel

# tar -zxvf rrdtool-1.2.26.tar.gz

# cd rrdtool-1.2.26

# ./configure --prefix=/usr/local/rrdtool --enable-perl-site-install=/usr/lib/perl5/

# make

# make install

(5)       复制mailgraph_ext/usr/local,并启动之

# cp -r /var/www/extsuite/extman/addon/mailgraph_ext  /usr/local 

# /usr/local/mailgraph_ext/mailgraph-init  start

# /usr/local/mailgraph_ext/qmonitor-init  start

# /usr/bin/perl -w /var/www/extsuite/extman/daemon/cmdserver -d

(6)       添加到自动启动队列

echo "/usr/local/mailgraph_ext/mailgraph-init start" >>/etc/rc.local

echo "/usr/local/mailgraph_ext/qmonitor-init start" >>/etc/rc.local

echo “/usr/bin/perl -w /var/www/extsuite/extman/daemon/cmdserver -d” >>/etc/rc.local

你可能感兴趣的:(系统,搭建)