In my previous post I wrote that installing memcached went fairly smoothly. I chose to install directly from source rather than from a package repository to make sure I had the most recent version available, because Ubuntu 8.10 ships with version 1.2.2 of memcached, whereas 1.2.6 is the latest. These are the steps that I took.
In case you are starting off from a clean install, like me, you might need to install the C/C++ compiler and Make in order to get going:
sudo apt-get install g++ make
memcached is dependent on libevent, which is an event notification library, so we should install it first:
wget http://www.monkey.org/~provos/libevent-1.4.9-stable.tar.gz tar xvfz libevent-1.4.9-stable.tar.gz cd libevent-1.4.9-stable/ ./configure && make sudo make install
By default, libevent gets installed into /usr/local/lib/, which may or may not be a known library path for the dynamic linker in your system. To make sure, add it in like this:
sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/libevent.conf' sudo ldconfig -v
The verbose option -v to ldconfig is just there so you can watch the output and conclude that ldconfig sees /usr/local/lib/ and the libevent files.
Installing memcached is very similar to the above steps:
wget http://danga.com/memcached/dist/memcached-1.2.6.tar.gz tar xvfz memcached-1.2.6.tar.gz cd memcached-1.2.6/ ./configure && make sudo make install
By default, memcached gets installed into /usr/local/bin/, and to test run it you can do:
Again, the double verbose option is there just so you can see that something is happening. For actual production use, you will want to use other options too, for example -d for daemon mode and -m for adjusting the memory limit.