1.准备工作
由于memcached需要libevent支持,所以需要先安装libevent。
a.下载libevent
[code]
wget -c http://monkey.org/~provos/libevent-1.3e.tar.gz
[/code]
b.解压
[code]
tar xzvf libevent-1.3e.tar.gz
[/code]
c.编译,安装
[code]
./configure
make
make install
[/code]
2.下载最新版的memecached(到写本文为止,最新版为1.2.2)
[code]
wget -c http://www.danga.com/memcached/dist/memcached-1.2.2.tar.gz
[/code]
3.解压
[code]
tar xzvf memcached-1.2.2.tar.gz
[/code]
4.编译安装
[code]
./configure --prefix=/usr/local/memcached
make
make install
[/code]
5.添加用户
[code]
/usr/sbin/adduser -r memcached -d /usr/local/memcached
[/code]
6.更换登录用户,运行
[code]
su - memcached
bin/memcached -d
[/code]
[color=red]
注:如果出现缺少库,无法运行时,请把libevent库路径添加到搜索路径中。
[code]
vi /etc/ld.so.conf
[/code]
并重新载入配置
[code]
/sbin/ldconfig
[/code]
[/color]
由于memcached需要libevent支持,所以需要先安装libevent。
a.下载libevent
[code]
wget -c http://monkey.org/~provos/libevent-1.3e.tar.gz
[/code]
b.解压
[code]
tar xzvf libevent-1.3e.tar.gz
[/code]
c.编译,安装
[code]
./configure
make
make install
[/code]
2.下载最新版的memecached(到写本文为止,最新版为1.2.2)
[code]
wget -c http://www.danga.com/memcached/dist/memcached-1.2.2.tar.gz
[/code]
3.解压
[code]
tar xzvf memcached-1.2.2.tar.gz
[/code]
4.编译安装
[code]
./configure --prefix=/usr/local/memcached
make
make install
[/code]
5.添加用户
[code]
/usr/sbin/adduser -r memcached -d /usr/local/memcached
[/code]
6.更换登录用户,运行
[code]
su - memcached
bin/memcached -d
[/code]
[color=red]
注:如果出现缺少库,无法运行时,请把libevent库路径添加到搜索路径中。
[code]
vi /etc/ld.so.conf
[/code]
并重新载入配置
[code]
/sbin/ldconfig
[/code]
[/color]