HowTo install memcached from sources on Linux
Install Libevent 1.3e
I will assume that you donâ€™t have libevent installed already on your system. Your system might already have libevent installed, but normally you will have a very old version (for ex. on debian etch the packaged libevent is 1.1a that was released in 2005); in this case you will want to remove the system package first (for ex. on debian run: aptitude purge libevent1). If you have a recent version packaged by your linux distribution you should keep it and move on the next step to install directly memcached.
Download, and install the latest version of libevent (check for the latest version, and change if needed the versions bellow):
This will install by default the libraries under /usr/local/lib/. If you want it in another place you can do that by passing to configure a different prefix.
Depending on your system you might have already /usr/local/lib included in your ld configuration. If this is not the case (like on my test debian box) you can add it inside /etc/ld.so.conf, or as a nice debian Ã¢â‚¬Å“thingÃ¢â‚¬Â you can just create a new file inside /etc/ld.so.conf.d/ like:
##add a line containing:
Regardless of your choice you should run ldconfig to complete this step:
(and check the output to be sure that the /usr/local/lib has been properly included).
Install Memcached 1.2.4
tar zxvf memcached-1.2.4.tar.gz
The memcached binary will be also installed by default under /usr/local/bin/. You can start the daemon by simply running: /usr/local/bin/memcached. The basic memcached options are:
memcached -d [-m memory_in_megabytes [-l listen_ip_address [-p listen_port]]]
memcached -d -m 256 -u nobody -p 11211 -l 192.168.0.1
will be used to run a memcached daemon bind on 192.168.0.1 on the default port 11211 using max 256MB memory.