Artur Krzywanski

Installing memcached and libmemcache on Debian

by Artur on Sep.30, 2009, under Sysadmin

memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.

To use it with C++ apps you also need libmemcached which is client library to the memcached server. It has been designed to be light on memory usage, thread safe, and provide full access to server side methods.

As far as I know there is no Debian package for libmmemcached but there is one for memcached.

Installing memcache

The easiest way is to install it via APT:

user@computer:$ apt-get install memcached

Installing libmemcached

You will have to compile it yourself using source code

user@computer:$ cd /usr/local/src/
wget http://download.tangent.org/libmemcached-0.31.tar.gz
tar -zxf libmemcached-0.31.tar.gz
cd libmemcached-0.31
./configure
make
make install

For some reason it did not work until I created this symlink (C++ was looking for this lib here)

user@computer:$ cd /usr/lib/
ln -s /usr/local/lib/libmemcached.so.2 .

I’ve put all those commands in a small SH script:

#!/bin/sh
echo "Installing memcached"
apt-get install -y memcached
echo "Installing libmemcached-0.31"
cd /usr/local/src/
wget http://download.tangent.org/libmemcached-0.31.tar.gz
tar -zxf libmemcached-0.31.tar.gz
cd libmemcached-0.31
./configure
make
make install
echo "Creating symlink /usr/lib/libmemcached.so.2 => /usr/local/lib/libmemcached.so.2"
cd /usr/lib/
ln -s /usr/local/lib/libmemcached.so.2 .
echo "Installation finished"

 

P.S. Some sentances were stolen from memcached and libmemecached websites, I’m too lazy to write something that was already written.

Bookmark and Share
:, , ,

2 Comments for this entry

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...