Ubuntu Memcache安装及使用

  1. 先安装libevent
    官网:http://www.monkey.org/~provos/libevent/
# wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
# tar zxvf libevent-2.1.8-stable.tar.gz
# cd libevent-2.1.8-stable
# ./configure --prefix=/usr
# make
# make install
  1. 测试libevent是否安装成功:
# ls -al /usr/lib | grep libevent
lrwxrwxrwx 1 root root 21 11?? 12 17:38 libevent-1.2.so.1 -> libevent-1.2.so.1.0.3
-rwxr-xr-x 1 root root 263546 11?? 12 17:38 libevent-1.2.so.1.0.3
-rw-r--r-- 1 root root 454156 11?? 12 17:38 libevent.a
-rwxr-xr-x 1 root root 811 11?? 12 17:38 libevent.la
lrwxrwxrwx 1 root root 21 11?? 12 17:38 libevent.so -> libevent-1.2.so.1.0.3

还不错,都安装上了。
4.安装memcached,同时需要安装中指定libevent的安装位置:

# wget http://www.danga.com/memcached/dist/memcached-1.4.0.tar.gz
# tar zxvf memcached-1.4.0.tar.gz
# cd memcached-1.4.0
# ./configure --with-libevent=/usr
# make
# make install

如果中间出现报错,请仔细检查错误信息,按照错误信息来配置或者增加相应的库或者路径。
安装完成后会把memcached放到 /usr/local/bin/memcached ,

5.测试是否成功安装memcached:

ls -al /usr/local/bin/mem*

-rwxr-xr-x 1 root root 137986 11?? 12 17:39 /usr/local/bin/memcached
-rwxr-xr-x 1 root root 140179 11?? 12 17:39 /usr/local/bin/memcached-debug

你可能感兴趣的:(Ubuntu Memcache安装及使用)