- 安装编译libevent
tar -zxvf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr
配置报错,不着急,安装gcc试试
可以了
make
make install
测试libevent是否安装成功
ls -al /usr/lib|grep libevent
安装成功
2.编译memcached
tar -zxvf memcached-1.4.5.tar.gz
cd memcached-1.4.5
./configure --with-libevent=/usr
报错,别急
Cd /opt/memcached-1.4.5/Makefile
-Werror注释掉
Source Makefile重启一下配置
make
make install
测试memcached是否安装成功
ls -al /usr/local/bin/ |grep memcached
3.启动memcached
memcached -d -u root -m 1024 -p 11211
报错如:memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
解决办法:cp /usr/lib/libevent* /usr/lib64/
写入开机启动项
/etc/rc.local 加入
/usr/local/bin/memcached -d -u root -m 1024 -p 11211
这是mysql+tomcat+mencached安装,tomcat的安装有机会再作更新,数据库已经做过讲解,需要的可以看看前面的博客