Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

71 lines (46 sloc) 2.71 kb
mod_libmemcached_cache - A memcached storage backend based on libmemcached for mod_cache
To build this Apache 2.x module, you need to install libmemcached first:
Download the latest version of libmemcached tarball from below:
Say, that we have libmemcached-0.26.tar.gz downloaded, use the following commands to build and install it to /opt/libmemcached or somewhere else:
tar xzvf libmemcached-0.26.tar.gz
cd libmemcached-0.26/
./configure --prefix=/opt/libmemcached
make -j2
sudo make install
And you'll also need the Apache source tree since Apache does not install mod_cache.h into the target directory but this module needs it.
To build this module, just type one command:
make MOD_CACHE_SRC_DIR=/path/to/httpd-2.x.x/modules/cache \
where we assumed you install libmemcached to /opt/libmemcached and apache2 to /opt/apache2. If it's not the case, just change the paths correspondingly.
To install:
make MOD_CACHE_SRC_DIR=/path/to/httpd-2.x.x/modules/cache \
LIBMEMCACHED=/opt/libmemcached install
You can also specify a DESTDIR=/some/where in the command above for RPM/Debian packaging purposes.
Sample httpd.conf configuration:
# you don't need the following line if you've already had mod_cache static linked into your Apache build
LoadModule cache_module modules/
LoadModule libmemcached_cache_module modules/
# Config of libmemcached_cache:
CacheEnable libmemcached /
Note that comma is required to seperate those memcached servers. Pure spaces won't work.
Some other configuration directives should also work but not tested yet:
LibmemCacheMaxObjectSize 1048576
LibmemCacheMinObjectSize 1
LibmemCacheMaxStreamingBuffer 1048576
Copyright (C) 2009 Yahoo! China EEEE Works, Alibaba Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
Jump to Line
Something went wrong with that request. Please try again.