LINUX安装memcached 服务器端

安装memcached 服务器端,需要先安装libevent库

wget http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
tar zxvf  libevent-1.4.14b-stable.tar.gz
cd  libevent-1.4.14b-stable
./configure --prefix=/usr
make
make install

安装 memcached

wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz
tar zxvf  memcached-1.4.5.tar.gz
cd memcached-1.4.5
./configure --prefix=/usr/local/webserver/memcache --with-libevent=/usr
make
make install

启动 memcached

/usr/local/webserver/memcache/bin/memcached -d -u nobody -m 20 127.0.0.1 -p 11211

如果需要memcached自启,请看下文:

vim /etc/rc.local

请在exit 0前添加以下语句:

/usr/local/webserver/memcache/bin/memcached -d -u nobody -m 20 127.0.0.1 -p 11211