linux上安装memcached

我的版本为Centos Release 5.3 (Final)
使用这个命令可以知道你的Linux版本
1、cat /etc/redhat-release
首先要安装libevent库。
cd /usr/local/src
curl -O http://monkey.org/~provos/libevent-1.4.10-stable.tar.gz
tar xzvf libevent-1.4.10-stable.tar.gz
cd libevent-1.4.10-stable
./configure –prefix=/usr/local【出现一个错误,应该是--。或者直接安装在./configure】
make
make install

2、

接下来就是安装memcached

【下载最新版的】

 

安装mkdir magent  

1.mkdir magent  
2.cd magent/  
3.wget http://memagent.googlecode.com/files/magent-0.5.tar.gz  
4.tar zxvf magent-0.5.tar.gz  
5./sbin/ldconfig  
6.sed -i "s#LIBS = -levent#LIBS = -levent -lm#g" Makefile  
7.make  
8.cp magent /usr/bin/magent  
9.cd ../ 

5、6、启动

  /usr/local/bin/memcached -d -m 10 -u root -l 10.232.74.204 -p 12000 -c 256 -P /tmp/memcached.pid【中间的ip地址是ifconfig查询与添加上的】

7、查看是否安装成功

netstat -tunlp

出现错误:

configure: error: cannot run /bin/sh ./config.sub

解决方案:http://blog.csdn.net/hero06206/article/details/7294499

linux上启动Memcache报错:error while loading shared libraries: libevent-1.4.so.2

解决方案:

ln -s /usr/lib/libevent-1.4.so.2 /usr/lib64/libevent-1.4.so.2

参考文章:http://chenzhou123520.iteye.com/blog/1925196

参考文章:

http://blog.csdn.net/zenwong/article/details/6708715

http://zhaochen.blog.51cto.com/2029597/390037

http://www.itokit.com/2011/0527/66305.html

原文地址:https://www.cnblogs.com/bluewelkin/p/3939861.html