- 论坛徽章:
- 0
|
九、安装配置courier-authlib和Courier-IMAP
1、下载courier-authlib和courier-imap
http://www.courier-mta.org/?download.php
下载文件:courier-authlib-0.59.1.tar.bz2和courier-imap-4.1.2.tar.bz2
2、解压文件
# bunzip2 courier-authlib-0.59.1.tar.bz2
# tar xvf courier-authlib-0.59.1.tar
安装相关包:gdbm
#gunzip gdbm-1.8.3-sol8-sparc-local.gz
#pkgadd -d gdbm-1.8.3-sol8-sparc-local
//出现Installation of <SMCgdbm> was successful.表安装完成。
3、安装及配置:
# cd courier-authlib-0.59.1
# ./configure --with-mysql-libs=/usr/local/mysql/lib/mysql --with-mysql-includes=/usr/local/mysql/include/mysql --with-mailuser=vuser --with-mailgroup=vgroup --with-authmysql --with-authmysql=yes --with-authchangepwdir
# make && make install
# make install-configure
查看是否有以下配置文件(文件名相同,一个扩展名为dist,一个为无扩展名)
# ls /usr/local/etc/authlib/
authProg authdaemonrc.dist authmysqlrc authdaemonrc authldaprc authldaprc.dist authmysqlrc.dist
修改文件/usr/local/etc/authlib/authdaemonrc
找到其中两行,改成以下:
authmodulelist="authmysql"
authmodulelistorig="authmysql"
编辑/usr/local/etc/authlib/authmysqlrc文件,内容为:
MYSQL_SERVER localhost
MYSQL_USERNAME extmail
MYSQL_PASSWORD extmail
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_PORT 3306
MYSQL_OPT 0
MYSQL_DATABASE extmail
MYSQL_USER_TABLE mailbox
MYSQL_CRYPT_PWFIELD password
MYSQL_UID_FIELD uidnumber
MYSQL_GID_FIELD gidnumber
MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD homedir
MYSQL_NAME_FIELD name
MYSQL_MAILDIR_FIELD maildir
MYSQL_QUOTA_FIELD quota
MYSQL_SELECT_CLAUSE SELECT username,password,"",uidnumber,gidnumber,\
CONCAT('/home/domains/',homedir), \
CONCAT('/home/domains/',maildir), \
quota, \
name \
FROM mailbox \
WHERE username = '$(local_part)@$(domain)'
设置该文档的相关权限:
# chmod 660 /usr/local/etc/authlib/authmysqlrc
# chown vuser:vgroup /usr/local/etc/authlib/authmysqlrc
# chown vuser:vgroup /usr/local/etc/authlib/authldaprc
4、设置启动
拷贝启动文件
# cp /var/tmp/courier-authlib-0.59.1/courier-authlib.sysvinit /etc/init.d/courier-authlib
# chmod 755 /etc/init.d/courier-authlib
启动courier-authlib:
# /etc/init.d/courier-authlib start
Starting Courier authentication services: authdaemond //启动完毕;
5、常见错误解决:
错误1:touch: /var/lock/subsys/courier-authlib cannot create.
解决:建立目录
# mkdir /var/lock
# mkdir /var/lock/subsys
错误2:
#authtest -s login test@test.com //建议这一步测试要等imap/maildrop配置完后再做,否则出错
Authentication FAILED: I/O error
解决:检查文件/usr/local/etc/authlib/authdaemonrc
出错3:mail authdaemond: [ID 702911 mail.debug] authpipe: disabled: failed to stat pipe program /usr/local/etc/authlib/authProg: No such file or directory
解决:
# touch /usr/local/etc/authlib/authProg
6、安装courier-imap
解压:
# bunzip2 courier-imap-4.1.2.tar.bz2
# tar xvf courier-imap-4.1.2.tar
安装:
# cd courier-imap-4.1.2
# ./configure --prefix=/usr/local/courier --enable-unicode=utf-8,iso-8859-1,gb2312 --with-mysql-libs=/usr/local/mysql/lib/mysql -with-mysql-includes=/usr/local/mysql/include/mysql --with-authmysql=yes --with-authchangepwdir --disable-root-check --with-trashquota --with-dirsync --with-db=gdbm --with-waitfunc=wait3
# make && make install
# make install-configure
安装路径:/usr/local/courier
7、配置Courier-IMAP
主要通过Courier-IMAP,为用户提供pop3服务:
# vi /usr/local/courier/etc/pop3d
将其中一行改为如下:
POP3DSTART=yes
8、设置启动
# cp /export/home/ftp/courier-imap-4.1.2/courier-imap.sysvinit /etc/init.d/courier-imap
# chmod 744 /etc/init.d/courier-imap
# /etc/init.d/courier-imap start
Starting Courier-IMAP server: pop3
测试是否启动:
# lsof -i:110 //出现以下相关信息,表示启动成功
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
couriertc 23048 root 3u IPv6 0x300023ed9d8 0t0 TCP *:pop3 (LISTEN)
couriertc 23048 root 5u IPv4 0x300015056d0 0t0 TCP *:pop3 (LISTEN)
常见出错1:
Feb 23 07:37:49 mail pop3d: [ID 702911 mail.info] ld.so.1: couriertcpd: fatal: libgdbm.so.3: open failed: No such file or directory
ld.so.1: couriertcpd: fatal: libgdbm.so.3: open failed: No such file or directory
解决:
# ln -s /usr/local/lib/libgdbm.so.3 /usr/lib/libgdbm.so.3
9、设置Courier-authlib和Courier-imap的开机自动启动
# ln -s /etc/init.d/courier-authlib /etc/rc3.d/S51authlib
# ln -s /etc/init.d/courier-authlib /etc/rc0.d/K15authlib
# ln -s /etc/init.d/courier-authlib /etc/rc1.d/K15authlib
# ln -s /etc/init.d/courier-authlib /etc/rc2.d/K15authlib
# ln -s /etc/init.d/courier-imap /etc/rc3.d/S51imap
# ln -s /etc/init.d/courier-imap /etc/rc0.d/K51imap
# ln -s /etc/init.d/courier-imap /etc/rc1.d/K51imap
# ln -s /etc/init.d/courier-imap /etc/rc2.d/K51imap
十、安装Maildrop
1、下载Maildrop:
http://www.courier-mta.org/download.php#maildrop
http://sourceforge.net/projects/courier/
文件名:maildrop-2.0.3.tar.bz2
2、解压和安装:
# bunzip maildrop-2.0.3.tar.bz2
# tar xvf maildrop-2.0.3.tar
安装
先安装支持包:pcre-6.7-sol8-sparc-local.gz
# gunzip pcre-6.7-sol8-sparc-local.gz
# pkgadd -d pcre-6.7-sol8-sparc-local
Installation of <SMCpcre> was successful.
# cd maildrip-2.0.3
# ./configure --prefix=/usr/local/maildrop --enable-sendmail=/usr/sbin/sendmail --enable-maildropmysql --with-mysqlconfig=/etc/postfix/mysql_maildrop.conf --enable-maildirquota --with-trashquota --with-dirsync --enable-trusted-users='root maildrop' --enable-maildrop-uid=1000 --enable-maildrop-gid=1000
# make
# make install-strip
# make install-man
修改/etc/master.cf文件
# vi /etc/master.cf
查找以下内容,改成如下,将第一行加注释,第二行为新加内容
# flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
flags=DRhu user=vuser argv=maildrop -w 90 -d ${user}@${nexthop} ${recipient} ${user} ${extension} {nexthop}
3、测试:
执行maildrop –v
# /usr/local/maildrop/bin/maildrop -v
maildrop 2.0.3 Copyright 1998-2005 Double Precision, Inc.
GDBM extensions enabled.
Courier Authentication Library extension enabled.
Maildir quota extension enabled.
This program is distributed under the terms of the GNU General Public
License. See COPYING for additional information.
Courier Authentication Library extension enabled.出现这行,表示支持courier auth.
观察下面的操作,出现类似内容,说明maildrop 已投递正常
# echo "test"|maildrop -V 10 -d test@extmail.org
maildrop: authlib: groupid=1000
maildrop: authlib: userid=1000
maildrop: authlib: logname=test@extmail.org, home=/home/data/domains/extmail.org/test, mail=/home/data/domains/extmail.org/test/Maildir/
maildrop: Changing to /home/data/domains/extmail.org/test
Message start at 0 bytes, envelope sender=test@extmail.org
maildrop: Attempting .mailfilter
WARN: quota string '5242880' not parseable
maildrop: Delivery complete.
4、常见错误解决:
出错1:
configure: error: pcre.h not found - install PCRE from www.pcre.org
pcre-6.7-sol8-sparc-local.gz
# gunzip pcre-6.7-sol8-sparc-local.gz
# pkgadd -d pcre-6.7-sol8-sparc-local
Installation of <SMCpcre> was successful.
出错2:checking location of system mailboxes... ./configure: whoami: command not found
configure: error: Unable to run whoami
新建文件/usr/bin/whoami
# vi /usr/bin/whoami
文件内容如下:
#!/bin/sh
who am i
设置可以执行权限:
# chmod a+x /usr/bin/whoami
出错3:Feb 24 12:05:14 mail pipe[6651]: [ID 947731 mail.crit] fatal: pipe_command: execvp maildrop: No such file or directory
解决:
# ln -s /usr/local/maildrop/bin/maildrop /usr/local/bin/maildrop
测试110的一些错误解决:
# echo "test"|maildrop -V 10 -d test@zh.test.com
ERR: authdaemon: s_connect() failed: No such file or directory
maildrop: Temporary authentication failure.
解决:
# ln -f /usr/local/maildrop/bin/maildrop /usr/local/bin/maildrop
出错: mail pop3d: ld.so.1: pop3login: fatal: libgcc_s.so.1: open failed: No such file or directory
# ln -s /usr/local/lib/libgcc_s.so.1 /usr/lib/libgcc_s.so.1
十一、安装配置Apache和PHP
1、下载安装apache
http://www.sunfreeware.com/
文件名:apache-2.0.59-sol8-sparc-local.gz
# gunzip apache-2.0.59-sol8-sparc-local.gz
# pkgadd -d apache-2.0.59-sol8-sparc-local
Installation of <SMCap2059> was successful. //出现这些为安装完成,安装目录为/usr/local/apache2
2、配置及启动
复制httpd.conf配置文件
# cp /usr/local/apache2/conf/httpd-std.conf /usr/local/apache2/conf/httpd.conf
修改httpd.conf文件:
其中一行改成:
User vuser
Group vgroup
启动apahce2
# /usr/local/apache2/bin/apachectl start
如果不能正常启动,请查看日志目录下的文档:/usr/local/apache2/logs
3测试:
可以使用命令lsof -i:80或在浏览器里输入http://ip,如果正常,则能得到相关信息。
4、设置APACHE开机启动
# cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
# chmod 755 /etc/init.d/httpd
# ln -s /etc/init.d/httpd /etc/rc3.d/S51httpd
# ln -s /etc/init.d/httpd /etc/rc0.d/K15httpd
# ln -s /etc/init.d/httpd /etc/rc1.d/K15httpd
# ln -s /etc/init.d/httpd /etc/rc2.d/K15httpd
5、下载安装PHP
下载:http://www.sunfreeware.com/
文件名:php-5.2.0-sol8-sparc-local.gz
安装
# gunzip php-5.2.0-sol8-sparc-local.gz
# pkgadd -d php-5.2.0-sol8-sparc-local
Installation of <SMCphp> was successful. //表示安装完成。
安装目录为:/usr/local/php
6、配置php5
修改httpd.conf,增加以下两行:
# vi /usr/local/apache2/conf/httpd.conf
在相应位置添加以下两行:
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php .php3
复制PHP配置文件
# cp /usr/local/php/doc/php/php.ini-recommended /usr/local/php/lib/php/php.ini
安装GD库:(这个为可选安装)
expat-1.95.5-sol8-sparc-local.gz
freetype-2.1.9-sol8-sparc-local.gz
fontconfig-2.2.98-sol8-sparc-local.gz
jpeg-6b-sol8-sparc-local.gz
libpng-1.2.16-sol8-sparc-local.gz
xpm-3.4k-sol8-sparc-local.gz
gd-2.0.33-sol8-sparc-local.gz
7、常见错误解决:
错误1:
# /usr/local/apache2/bin/apachectl stop
Syntax error on line 255 of /usr/local/apache2/conf/httpd.conf:
Cannot load /usr/local/apache2/modules/libphp5.so into server: ld.so.1: httpd: fatal: libxml2.so.2: open failed: No such file or directory
解决:
# gunzip libxml2-2.6.26-sol8-sparc-local.gz
# pkgadd -d libxml2-2.6.26-sol8-sparc-local
8、测试apache和php
测试php是否成功:
新建aa.php文件放入/usr/local/apache2/htdocs/里,内容为:
<?php
phpinfo();
?>
然后启动apache,在地址栏里输入http://ip/aa.php,如能显示php配置内容,表示安装成功。
9、配置Apache与Extmail的关联
编辑/usr/local/apache2/conf/httpd.conf文件,在最后一行加上:
NameVirtualHost *:80
Include conf/vhost_*.conf
编辑/usr/local/apache2/conf/vhost_extmail.conf,里面定义虚拟主机的相关内容,包括主目录,以及ExtMail和ExtMan的相关配置等。内容如下:
# VirtualHost for ExtMail Solution
<VirtualHost *:80>
ServerName mail.zh.test.com
DocumentRoot /var/www/extsuite/extmail/html/
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/
</VirtualHost>
重启apache
# /etc/init.d/httpd restart
十二、安装Perl
1、下载perl
下载地址:http://www.cpan.org/src/README.html
http://www.cpan.org/src/stable.tar.gz(当前稳定版本为5.8.
以下为源码安装perl-5.8.8
# ./configure.gnu
# make
# make test
# make install
2、其它模块安装:
下载点:http://search.cpan.org/
一般为安装方法:
# perl Makefile.PL
# make && make install
File-Tail-0.99.3.tar .gz
Time-HiRes-1.9707.tar.gz
Net-Daemon-0.39.tar.gz
PlRPC-0.2018.tar.gz
DBI-1.54.tar.gz
DB_File-1.815.tar.gz
Unix-Syslog-0.100.tar.gz
DBD-mysql-4.004.tar.gz
Math-Complex-1.37.tar.gz
GD-2.35.tar.gz
出错1:
在perl Makefile.PL时出错:version.c:30:16: db.h: No such file or directory
make: *** [version.o] Error 1
# ln -s /usr/local/BerkeleyDB.4.2 /usr/local/BerkeleyDB
libart_lgpl-2.3.16.tar.gz(rrdtool需要) |
|