How to install Memcached on CentOS
Memcached (Daemon) Installation on CentOS:
- Try to install with yum:
# yum install libevent libevent-devel
If this succeeds skip to #5. If this fails, then let’s compile. Download and extract the latest stable version:
# cd /usr/local/src && wget http://monkey.org/~provos/libevent-2.0.14-stable.tar.gz && tar -xzf libevent-2.0.12-stable.tar.gz && cd libevent-2.0.12-stable
- Let’s compile:
# ./configure && make && make install
- In the output you should see:
Libraries have been installed in: /usr/local/lib
If so you can:
# echo "/usr/local/lib/" > /etc/ld.so.conf.d/libevent.conf
- Configure your server for the new install:
# ldconfig -v
- Now find the latest stable memcached, download and extract:
# cd /usr/local/src && wget http://memcached.googlecode.com/files/memcached-1.4.6.tar.gz && tar -xzf memcached-1.4.6.tar.gz && cd memcached-1.4.6
- Let’s compile:
# ./configure && make && make install
- Make sure memcached is starts automatically on server boot:
# touch /etc/init.d/memcached # echo '#!/bin/sh -e' >> /etc/init.d/memcached # echo '/usr/local/bin/memcached -d -m 128 -p 11211 -u nobody -l localhost' >> /etc/init.d/memcached # chmod u+x /etc/init.d/memcached # echo '/etc/init.d/memcached' >> /etc/rc.local
- And finally, let’s start memcached:
# /etc/init.d/memcached
Recommended Posts
Virtualmin – Migrating to a new server
24th November 2016