You are here

How to install Memcached on CentOS 5

Okay so since I don't particularly like to assume the trust of installing 3rd party yum repositories, I install most new software packages by compiling from source as previously mentioned. This undoubtedly makes it more difficult than using the yum command but I think its a sacrifice with respect to trust and security.

So this is how I do the install for Memcached (I have not tested the pecl install memcached as yet.. this is just to get memcached cache server installed). Also, this is for 32-bit.

INSTALL LIBEVENT FIRST
wget -t 10 https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.ta...
tar -xvf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure
make && make install

THEN INSTALL MEMCACHE
wget -t 10 http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz
tar -xvf memcached-1.4.15.tar.gz
cd memcached-1.4.15
./configure --enable-threads --with-libevent=/usr/local
make && make install

NICE, IF ALL GOES WELL, YOU HAVE MEMCACHED INSTALLED BUT NOT RUNNING.
TO RUN MEMCACHE, I USE:
memcached -d -u nobody -m 64 -p 11211 127.0.0.1

Notice at the top the -m 64 which tells memcache to use 64MB of memory. You can increase this depending on your RAM needs.

Good luck!

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.