Chinaunix首页 | 论坛 | 博客
  • 博客访问: 658061
  • 博文数量: 107
  • 博客积分: 4135
  • 博客等级: 上校
  • 技术积分: 1182
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-06 16:01
文章分类

全部博文(107)

文章存档

2020年(2)

2012年(5)

2011年(6)

2010年(23)

2009年(17)

2008年(35)

2007年(19)

我的朋友

分类: LINUX

2008-08-29 13:57:56

安装

[root@mail /home/down]#wget

 

[root@mail /home/down]#tar jxvf courier-authlib-0.59.3.tar.bz2

[root@mail /home/down]#cd courier-authlib-0.59.3

./configure --with-redhat --with-authmysql=yes --with-mailuser=vmail --with-mailgroup=vmail --with-mysql-libs=/usr/lib/mysql --with-mysql-includes=/usr/include/mysql --prefix=/usr/local/authlib --without-stdheaderdir

 

注意mysql 的目录 如果mysql安装路径不同需要修改 例如with-mysql-libs=/usr/local/mysql/lib --with-mysql-includes=/usr/local/mysql/include

 

出现这个错误

--with-authmysql specified but no mysqlclient.so

 

mysql-devel-5.0.22-2.1.i386.rpm

 

make 出现这个错误exec: g++: not found

 

安装gcc-c++-4.1.1-52.el5.i386.rpm

 

[root@mail /home/down/courier-authlib-0.59.3]#make

[root@mail /home/down/courier-authlib-0.59.3]#make install

[root@mail /home/down/courier-authlib-0.59.3]#make install-configure

 

[root@mail /home/down/courier-authlib-0.59.3]#grep "authdaemonvar" /usr/local/authlib/etc/authlib/authdaemonrc

##NAME: authdaemonvar:2

# authdaemonvar is here, but is not used directly by authdaemond.  It's

authdaemonvar=/usr/local/authlib/var/spool/authdaemon

 

最后一行authdaemond_paeth的设置来自anthlib 的配置文件authlibdaemonrc,千万不要把这个弄错了,我当初的smtp验证一直通不过就是由于这个原因。通过查看进程也可以知道这个路径(前提是authlib正常运行了),如下图所示:
图 4
Sasl2需要使用文件/usr/local/authlib/var/spool/authdaemon/socket,但默认情况下,其属性是744,需要把它加上执行权限,以便文件属组(主)而外的其它用户可以执行。运行命令
chmod +x /usr/local/authlib/var/spool/authdaemon
即可,如果不这样处理,smtp验证无一例外会失败的。

 

 

MYSQL_SERVER            localhost   //26

MYSQL_USERNAME          extmail   //27

MYSQL_PASSWORD          extmail   //28

MYSQL_SOCKET          /var/lib/mysql/mysql.sock  //49

MYSQL_PORT              3306  //56

MYSQL_DATABASE          extmail    //68

MYSQL_USER_TABLE        mailbox   //75

MYSQL_CRYPT_PWFIELD     password  //84

DEFAULT_DOMAIN                mail.com  //97

MYSQL_UID_FIELD         '1001'  //105

MYSQL_GID_FIELD         '1001'  //111

MYSQL_LOGIN_FIELD       username  //120

MYSQL_HOME_FIELD        concat('/var/mailbox/',maildir)  //125

MYSQL_MAILDIR_FIELD     concat('/var/mailbox/',maildir)  //142

 

共享链接库

[root@mail /home/down/courier-authlib-0.59.3]#echo "/usr/local/authlib/lib/courier-authlib" >> /etc/ld.so.conf

[root@mail /home/down/courier-authlib-0.59.3]#ldconfig -v 

 

启动及加入到自动运行队列

[root@mail /home/down/courier-authlib-0.59.3]#cp courier-authlib.sysvinit /etc/init.d/courier-authlib

[root@mail /home/down/courier-authlib-0.59.3]#chmod 755 /etc/init.d/courier-authlib

[root@mail /home/down/courier-authlib-0.59.3]#chkconfig --add courier-authlib

[root@mail /home/down/courier-authlib-0.59.3]#chkconfig --level 2345 courier-authlib on

[root@mail /home/down/courier-authlib-0.59.3]#service courier-authlib start

Starting Courier authentication services: authdaemond

[root@mail /home/down/courier-authlib-0.59.3]#chmod +x /usr/local/authlib/var/spool/authdaemon

 

 

安装SASL

安装

[root@mail /home/down]#tar zxvf cyrus-sasl-2.1.21.tar.gz

[root@mail /home/down]#cd cyrus-sasl-2.1.21

[root@mail /home/down/cyrus-sasl-2.1.21]#./configure --prefix=/usr/local/sasl2 --disable-anon -enable-plain --enable-login --enable-sql --with-mysql=/usr/local/mysql --with-mysql-includes=/usr/local/mysql/include --with-mysql-libs=/usr/local/mysql/lib --with-authdaemond=/usr/local/authlib/var/spool/authdaemon/socket

make

make install

如果在编译过程(make)出现错误,如“client.c:64: error: static declaration of 'global_callbacks' follows non-static declaration saslint.h:112…”,需要加一个补丁程序,然后再执行编译过程。补充:如果使用cyrus-sasl-2.1.21这个版本,则不会出现这个问题.

vi在当前位置创建补丁文件,起名为sasl.patch,其内容包括:

 

 

--- cyrus-sasl-2.1.20/lib/client.c~     2003-11-11 11:26:06.000000000 -0500

+++ cyrus-sasl-2.1.20/lib/client.c      2005-05-31 22:34:14.000000000 -0400

@@ -61,7 +61,7 @@

 

 static cmech_list_t *cmechlist; /* global var which holds the list */

 

-static sasl_global_callbacks_t global_callbacks;

+sasl_global_callbacks_t global_callbacks;

 

 static int _sasl_client_active = 0;

 

[root@mail /home/down/cyrus-sasl-2.1.21]#patch -p1 < sasl.patch

[root@mail /home/down/cyrus-sasl-2.1.21]#make

[root@mail /home/down/cyrus-sasl-2.1.21]#make install

 

共享链接库

[root@mail /home/down/cyrus-sasl-2.1.21]#mv /usr/lib/sasl2 /usr/lib/sasl2.OFF

[root@mail /home/down/cyrus-sasl-2.1.21]#ln -sv /usr/local/sasl2/lib/* /usr/lib

创建指向“/usr/local/sasl2/lib/libsasl2.la”的符号链接“/usr/lib/libsasl2.la

创建指向“/usr/local/sasl2/lib/libsasl2.so”的符号链接“/usr/lib/libsasl2.so

创建指向“/usr/local/sasl2/lib/libsasl2.so.2”的符号链接“/usr/lib/libsasl2.so.2

创建指向“/usr/local/sasl2/lib/libsasl2.so.2.0.21”的符号链接“/usr/lib/libsasl2.so.2.0.21

创建指向“/usr/local/sasl2/lib/sasl2”的符号链接“/usr/lib/sasl2

[root@mail /home/down/cyrus-sasl-2.1.21]#ln -sv /usr/local/sasl2/lib/* /usr/local/lib

创建指向“/usr/local/sasl2/lib/libsasl2.la”的符号链接“/usr/local/lib/libsasl2.la

创建指向“/usr/local/sasl2/lib/libsasl2.so”的符号链接“/usr/local/lib/libsasl2.so

创建指向“/usr/local/sasl2/lib/libsasl2.so.2”的符号链接“/usr/local/lib/libsasl2.so.2

创建指向“/usr/local/sasl2/lib/libsasl2.so.2.0.21”的符号链接“/usr/local/lib/libsasl2.so.2.0.21

创建指向“/usr/local/sasl2/lib/sasl2”的符号链接“/usr/local/lib/sasl2

[root@mail /home/down/cyrus-sasl-2.1.21]#ln -sv /usr/local/sasl2/include/sasl/* /usr/local/include

创建指向“/usr/local/sasl2/include/sasl/hmac-md5.h”的符号链接“/usr/local/include/hmac-md5.h

创建指向“/usr/local/sasl2/include/sasl/md5global.h”的符号链接“/usr/local/include/md5global.h

创建指向“/usr/local/sasl2/include/sasl/md5.h”的符号链接“/usr/local/include/md5.h

创建指向“/usr/local/sasl2/include/sasl/prop.h”的符号链接“/usr/local/include/prop.h

创建指向“/usr/local/sasl2/include/sasl/sasl.h”的符号链接“/usr/local/include/sasl.h

创建指向“/usr/local/sasl2/include/sasl/saslplug.h”的符号链接“/usr/local/include/saslplug.h

创建指向“/usr/local/sasl2/include/sasl/saslutil.h”的符号链接“/usr/local/include/saslutil.h

[root@mail /home/down/cyrus-sasl-2.1.21]#mkdir -pv /var/state/saslauthd

mkdir: 已创建目录 /var/state

mkdir: 已创建目录 /var/state/saslauthd

[root@mail /home/down/cyrus-sasl-2.1.21]#echo "/usr/local/sasl2/lib" >> /etc/ld.so.conf

[root@mail /home/down/cyrus-sasl-2.1.21]#echo "/usr/local/sasl2/lib/sasl2" >> /etc/ld.so.conf

[root@mail /home/down/cyrus-sasl-2.1.21]# ldconfig -v

 

启动及加入到自动运行队列

[root@mail /home/down/cyrus-sasl-2.1.21]#echo "/usr/local/sasl2/sbin/saslauthd -a shadow pam">>/etc/rc.local

[root@mail /home/down/cyrus-sasl-2.1.21]#/usr/local/sasl2/sbin/saslauthd -a shadow pam

 

 

配置apache

[root@mail /home/down/cyrus-sasl-2.1.21]#mkdir -pv /var/www/extsuite

mkdir: 已创建目录 /var/www/extsuite

[root@mail /home/down/cyrus-sasl-2.1.21]#vi /etc/httpd/conf/httpd.conf

AddType application/x-httpd-php .php .phtml  //768

AddType application/x-httpd-php-source .phps  //769

  //305

最后加上

 ServerName redhat.mail.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

     SuexecUserGroup vmail vmail

     Alias /phpadmin /var/www/phpadmin

 

 

 

[root@mail /home/down/cyrus-sasl-2.1.21]#service httpd restart

 

阅读(2435) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~