You can build and install memcached from the source code directly, or you can use an existing operating system package or installation.
To install memcached on a RedHat, Fedora or CentOS host, use yum:
root-shell> yum install memcached
To install memcached on a Debian or Ubuntu host, use apt-get:
root-shell> apt-get install memcached
To install memcached on a Gentoo host, use emerge:
root-shell> emerge install memcached
To install on OpenSolaris, use the pkg command
to install the SUNWmemcached package:
root-shell> pkg install SUNWmemcached
You may also find memcached in the Coolstack project. For more details, see http://cooltools.sunsource.net/coolstack/.
On other Unix-based platforms, including Solaris, AIX, HP-UX and
Mac OS X, and Linux distributions not mentioned already, you will
need to install from source. For Linux, make sure you have a
2.6-based kernel, which includes the improved
epoll interface. For all platforms, ensure that
you have libevent 1.1 or higher installed. You
can obtain libevent from
libevent
web page.
You can obtain the source for memcached from memcached website.
To build memcached, follow these steps:
Extract the memcached source package:
shell> gunzip -c memcached-1.2.5.tar.gz | tar xf -
Change to the
memcached-1.2.5
directory:
shell> cd memcached-1.2.5
Run configure
shell> ./configure
Some additional options you may want to specify to configure:
If you want to specify a different installation directory,
use the --prefix option:
shell> ./configure --prefix=/opt
The default is to use the /usr/local
directory.
If you have installed libevent and
configure cannot find the library, use
the --with-libevent option to specify the
location of the installed library.
To build a 64-bit version of memcached (which will allow you to use a single instance with a large RAM allocation), use --enable-64bit.
To enable multi-threading support in
memcached, which will improve the
response times on servers with a heavy load, use
--enable-threads.
Run make to build memcached:
shell> make
Run make install to install memcached:
shell> make install

User Comments
Add your own comment.