安装认证库的准备条件
gcc GNU linker Libtool make
courier使用libtool创建共享库,所以libtool和它的必须得安装
在非linux平台上需要安装GNU linker
3)安装
# tar jxf courier-authlib-0.63.1.20110619.tar.bz2
# cd courier-authlib-0.63.1.20110619
# ./configure --prefix=/usr/lib/authlib --without-authpam \
--without-authcustom --without-authpgsql --without-authldap \
--without-authuserdb --without-authpwd --without-authshadow \
--without-authvchkpw --with-authmysql \
--with-authdaemonvar=/usr/lib/authlib/var \
--mandir=/usr/lib/man --without-stdheaderdir \
--sysconfdir=/usr/lib/authlib/etc \
--with-redhat
# make
# make install
# make install-configure
设置authlib的环境变量
# COURIERAUTHCONFIG=/usr/lib/authlib/bin/courierauthconfig
# export COURIERAUTHCONFIG
报错:
checking for expect... no
configure: WARNING: -----------------------------------------------------
configure: WARNING: expect not found - will not be able to change passwds
configure: WARNING: in webmail
configure: WARNING: -----------------------------------------------------
checking for pg_config... no
checking for mysql_config... no
checking for mysql_connect... no
checking for mysql_real_connect... no
configure: error: --with-authmysql specified but no mysqlclient.so
PHP默认是去的 /usr/lib/搜索mysqlclient.so,所以没有找到
# find / -name libmysqlclient.so
/usr/local/mysql/lib/mysql/libmysqlclient.so
# cp /usr/local/mysql/lib/mysql/libmysqlclient.so /usr/lib/libmysqlclient.so
4)安装完成以后
※ 配置文件
# ls /usr/local/etc/authlib/
authdaemonrc authdaemonrc.dist authldaprc authldaprc.dist
※ authdaemond启动脚本,几个应用程序和userdb脚本
# ls /usr/local/sbin/
authdaemond authpasswd courierlogger pw2userdb userdb userdb-test-cram-md5
authenumerate authtest makeuserdb qmail userdbpw
※ 各种认证模块比如shared library
# ls /usr/local/lib/courier-authlib/
libauthcustom.a libauthpam.la libauthuserdb.so libcourierauthsaslclient.a
libauthcustom.la libauthpam.so libauthuserdb.so.0 libcourierauthsaslclient.la
libauthcustom.so libauthpam.so.0 libcourierauth.a libcourierauthsaslclient.so
libauthcustom.so.0 libauthpipe.a libcourierauthcommon.a libcourierauthsaslclient.so.0
libauthldap.a libauthpipe.la libcourierauthcommon.la libcourierauthsasl.la
libauthldap.la libauthpipe.so libcourierauthcommon.so libcourierauthsasl.so
libauthldap.so libauthpipe.so.0 libcourierauthcommon.so.0 libcourierauthsasl.so.0
libauthldap.so.0 libauthuserdb.a libcourierauth.la libcourierauth.so
libauthpam.a libauthuserdb.la libcourierauthsasl.a libcourierauth.so.0
※ 包含authdaemond监听接口的子目录
# ls /usr/local/var/spool/authdaemon/
※ 头文件
# ls /usr/local/include/
courier_auth_config.h courierauthsasl.h mcrypt.h pcre.h php
courierauthdebug.h libltdl mutils pcreposix.h pngconf.h
courierauth.h libpng15 pcrecpparg.h pcre_scanner.h png.h
courierauthsaslclient.h ltdl.h pcrecpp.h pcre_stringpiece.h pnglibconf.h
如果以上文件均生成了,说明安装成功了
5)当系统启动时,为了初始化authentication library 的环境,需要将authdaemond设置成开机自启动
将下列启动脚本加入/etc/rc.d/rc.local文件中
/usr/local/sbin/authdaemond start