1.安装libevent
cd /tmp wget http://jaist.dl.sourceforge.net/project/levent/libevent/libevent-2.0/libevent-2.0.22-stable.tar.gz tar -zxvf libevent-2.0.22-stable.tar.gz cd libevent-2.0.22-stable ./configure --prefix=/usr/local/libevent make make install
2.安装memcached
cd /tmp wget http://memcached.org/files/memcached-1.4.22.tar.gz tar -zxvf memcached-1.4.22.tar.gz cd memcached-1.4.22 ./configure --enable-sasl --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent make make install
配置的时候报错:configure: error: Failed to locate the library containing sasl_server_init是缺少sasl开发库文件,centos下yum search sasl | grep dev
我安装的是yum install cyrus-sasl-devel.x86_64,网上还有安装的是libgsasl-devel
3.配置sasl用户密码
# saslauthd -v
saslauthd 2.1.23
authentication mechanisms: getpwent kerberos5 pam rimap shadow ldap
# vi /etc/sysconfig/saslauthd
MECH=shadow
# /etc/init.d/saslauthd restart
停止 saslauthd:[确定]
启动 saslauthd:[确定]
# ps aux | grep saslauthd
# /etc/init.d/saslauthd start
# chkconfig saslauthd on
# /usr/sbin/testsaslauthd -u root -p 123
0: OK "Success."
testsaslauthd出现0: NO "authentication failed"的解决方法
# setsebool -P allow_saslauthd_read_shadow 1
/usr/sbin/saslpasswd2 -a memcached -c root
Password:
Again (for verification):