How to install memcached
I am using CentOS release 5; to find what version you are using, enter cat /etc/redhat-release
at a bash prompt. That is not to say that these steps won’t work for other linux distros, I just haven’t tried them. Anyway, when I first tried to install memcached I could not create the Makefile due to a dependence on libevent. So first, from /usr/local/src:
curl -O http://monkey.org/~provos/libevent-1.3e.tar.gz tar xzvf libevent-1.3e.tar.gz cd libevent-1.3e ./configure --prefix=/usr/local make make install
Hopefully everything went smoothly for you there. Now on to getting memcached, again from /usr/local/src:
curl -O http://www.danga.com/memcached/dist/memcached-1.2.2.tar.gz tar xzvf memcached-1.2.2.tar.gz cd memcached-1.2.2 LDFLAGS='-Wl,--rpath /usr/local/lib' ./configure --prefix=/usr/local make make install
Now:
memcached -d -u root
No errors, let’s make sure it’s running:
ps aux | grep memcached
Awesome! Hey, that’s the name of the blog, how unoriginal.
Now to stop it:
pkill memcached
I hope that saved you some time.
For those curious as to what that LDFLAGS='-Wl,--rpath /usr/local/lib' is all about, enter at a bash prompt man ld
This post prevents the following errors:
configure: error: libevent is required
If It’s already installed, specify its path using –with-libevent=/dir/
memcached: error while loading shared libraries: libevent-1.3e.so.1: cannot open shared object file: No such file or directory
Thanks for reading, now find something to do at GoLark.com
8 Comments