Skip to content

FAQ: Installation: Memcached Server

maxicus edited this page Jun 17, 2019 · 4 revisions

Installation

Debian/Ubuntu

# apt-get -y install memcached

CentOS/RedHat/Other

yum install libevent libevent-devel memcached

Manual Installation

If none of the above works, you should try to install manually.

Install Libevent

cd /usr/local/src
wget https://github.com/libevent/libevent/releases/download/release-2.1.10-stable/libevent-2.1.10-stable.tar.gz
tar -xzf libevent-2.1.10-stable.tar.gz
cd libevent-2.1.10-stable
./configure && make && make install

Installation was successful if the output you see looks like this:

Libraries have been installed in: /usr/local/lib

Then:

echo "/usr/local/lib/" > /etc/ld.so.conf.d/libevent.conf
ldconfig -v

Install Memcached

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
./configure && make && make install

Start 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

Start Memcached

/etc/init.d/memcached
Clone this wiki locally