kieranbarnes Independent PHP, WordPress & CubeCart Programmer

Installing memcached on CentOS (cPanel)

Posted on January 23, 2010

Welcome to hell. No really, compared to installing memcached on Ubuntu, CentOSs really sucks. CentOS really sucks for package management.  Really sucks. Anyway, on to the point.

Here's how I installed memcached on CentOS, which I mainly use for cPanel.

LibEvent

Memcache requires LibEvent. Go to their site and get the latest version.

  1. wget http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz
  2. tar xvfz libevent-1.4.13-stable.tar.gz
  3. cd libevent-1.4.13-stable
  4. ./configure && make && make install

Compile and Install Memcache

Now you can install Memcache. Again you should check their site for the latest version.

  1. wget http://www.danga.com/memcached/dist/memcached-1.4.4.tar.gz
  2. tar xvfz memcached-1.4.4.tar.gz
  3. cd memcached-1.4.4
  4. ./configure && make && make install

If you are unlucky, you might need this line instead

  1. ./configure --with-lib-event=/usr/local && make && make install

This next bit is only required because the CentOS/memcached is nasty, test it.

  1. memcached

If it works, great! Skip this next bit.
If it doesn't work and throws an error about shared libraries and such, you might need to do this

  1. echo /usr/local/lib/ >> /etc/ld.so.conf.d/libevent-i386.conf

Now we need to make it start on bootup.

  1. cp scripts/memcached.sysv /etc/init.d/memcached
  2. chmod 755 /etc/init.d/memcached
  3. mkdir /var/run/memcached
  4. chkconfig memcached on
  5. chkconfig --list | grep memcached

The last line should return "on" values for 0,2,3,4,5

Now you want to install the PHP extension for memcached? Har har. GLWT!


Related posts

  1. Installing memcached on CentOS/cPanel
    memcached a (distributed) memory object caching system vital if your running a HA Linux* setup...
  2. Simple install of memcached on Ubuntu
    Memcached is a free, high performance distributed memory object caching system. In English, it can...
  3. Installing nginx & PHP-FPM securely on CentOS
    I won't go into the reasons why you should install nginx, if you're here, you've...
  4. Installing mytop on cpanel
    MyTop is one of the best MySQL monitoring tools available, written by a MySQL guru,...
  5. Installing RepoForge (RPMForge) in CentOS
    RepoForge (RPMForge) contains over 5,000 extra packages for CentO. Many new packages and some updated...

Posted by Kieran


Tagged as: Leave a comment
Comments (2) Trackbacks (1)
  1. This is what you needed to do. “Yum install cached”
    Done.

  2. Make that “yum install memcached” no need at all to try and compile for source, and it will load the prerequisites. Just did it.


Leave a comment

(required)