安装: rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm yum -y install cmake openssl openssl-devel pam_* libmcrypt libmcrypt-devel libmhash libmhash-devel patch make gcc gcc-c++ libtool libtool-libs libart_lgpl libart_lgpl-devel autoconf libjpeg libjpeg-devel libpng libpng-devel fontconfig fontconfig-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers yum install 2hash cyrus-sasl cyrus-sasl-plain cyrus-sasl-md5 cyrus-sasl-devel -y tar -zxvf mysql-5.1.31.tar.gz cd mysql-5.1.31 ./configure --prefix=/usr/local/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=innobase make;make install cd .. /usr/sbin/groupadd -g 999 mysql /usr/sbin/useradd -g 999 -u 999 mysql cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf sed -i 's/skip-federated/#skip-federated/g' /etc/my.cnf /usr/local/mysql/bin/mysql_install_db --user=mysql chmod +w /usr/local/mysql chown -R mysql /usr/local/mysql/var chgrp -R mysql /usr/local/mysql/. cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql chmod 755 /etc/init.d/mysql chkconfig --level 345 mysql on service mysql start /usr/local/mysql/bin/mysqladmin -u root password root echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf ldconfig ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql ln -s /usr/local/mysql/include/mysql /usr/include/mysql service mysql stop service mysql start wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.05.tar.gz tar -zxvf lzo-2.05.tar.gz cd lzo-2.05 ./configure make;make install cd .. echo "/usr/local/lib" >> /etc/ld.so.conf ldconfig tar -zxvf open***-2.0.9.tar.gz cd open***-2.0.9 ./configure make&&make install mkdir /etc/open*** cp -a sample-config-files/ sample-keys/ sample-scripts/ easy-rsa/ /etc/open*** cd .. cd /etc/open***/sample-config-files && cp server.conf ../ cd - cd /etc/open***/sample-keys && cp * ../ cd - wget http://prdownloads.sourceforge.net/pam-mysql/pam_mysql-0.7RC1.tar.gz tar -zxvf pam_mysql-0.7RC1.tar.gz cd pam_mysql-0.7RC1 ./configure --with-openssl --with-mysql=/usr/local/mysql make;make install echo "/lib/security" >> /etc/ld.so.conf ldconfig cd .. vi /etc/pam.d/open*** auth required /lib/security/pam_mysql.so user=root passwd=root host=localhost db=pam table=user usercolumn=name passwdcolumn=password where=active=1 sqllog=0 crypt=0 account required /lib/security/pam_mysql.so user=root passwd=root host=localhost db=pam table=user usercolumn=name passwdcolumn=password where=active=1 sqllog=0 crypt=0 /usr/local/mysql/bin/mysql -u root -p create database pam; use pam; create table user(name char(20) NOT NULL,password char(128) default NULL,active int(10) NOT NULL DEFAULT 1); insert into user (name,password) values ('test','test'); testsaslauthd -u test -p test -s open***