Categories
Server

How to Install Memcached in WHM / CentOS

I use Centos & WHM.
Here is how to install memcached (not memcache) using command line.

First, installing memcached

wget http://memcached.org/latest
tar -zxvf memcached-1.x.x.tar.gz
cd memcached-1.x.x
./configure && make && make test && sudo make install

After running the last command, i got this error

checking for libevent directory... configure: error: libevent is required.

You can get it from http://www.monkey.org/~provos/libevent/

If it’s already installed, specify its path using –with-libevent=/dir/

So now i must install libevent

wget http://monkey.org/~provos/libevent-x.x.x-stable.tar.gz
tar xzf libevent-x.x.x-stable.tar.gz
cd libevent-x.x.x-stable
./configure
make
make install

I tried to install memcached again

./configure && make && make test && sudo make install

Now i got a new error :

./sizes: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

Because my system is 64 bit, thanks to Nigel Dunn blog, i run this command :

ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5

Final step is run the memcached

memcached -d -u nobody -m 512 -p 11211 127.0.0.1

Leave a Reply

Your email address will not be published. Required fields are marked *