Tuesday, March 23, 2010

Installing memcached

On ubuntu:
* download the memcached source from memcached.org (it's on Google Code at http://code.google.com/p/memcached/)
* download the libevent source from http://www.monkey.org/~provos/libevent/
* open a terminal window
* cd to where the two tar.gz files are
* tar -zxvf memcached-1.4.4.tar.gz
* tar -zxvf libevent-1.4.10-stable.tar.gz
* cd into the libevent folder
* ./configure && make
* sudo make install
* cd up and into the memcached folder
* ./configure && make
* sudo make install
* at this point we could try starting memcached, but it would probably fall over with an error about . we need to give the memcached an easy way to find libevent. (running whereis libevent is good enough for us to verify where it's actually been installed: I suspect /usr/local/lib)
* sudo gedit /etc/ld.so.conf.d/libevent-i386.conf
* on it's own line in the file, enter the following, and save and quit gedit:
* /usr/local/lib/
* even though you may have just installed it on an amd64 box, the file name needs to be i386
* sudo ldconfig is the final set up step
* now fire up memcached in verbose mode (use the -vv parameter)
* alternatively run it in daemon mode (as it was intended, with the -d parameter)
* once it's up and run you can muck around with it by starting a telnet session
* telnet localhost 11211
* try some of the commands in the very helpful reference http://lzone.de/articles/memcached.htm
* :-)

No comments: