Following are steps to install memcached from source:
- Download latest version of memcached from http://memcached.org, uncompress it and enter into uncompressed directory.
- Install dependencies make and libevent-dev with apt-get.
$ apt-get install libevent-dev make
- After installation is completed run following commands:
$ ./configure
$ make
$ make install
This will complete installation of memcached.
Above installation will install will copy memcached executable file in path “
/usr/local/memcached/bin/memcached“
Now create an alias of memcahed executable in /usr/bin with following command:
$ ln -s /usr/local/memcached/bin/memcached /usr/bin/memcached
Start memcached in localhost
$ memcached -u root -d -m 1024 -p 11211 -l localhost
Above command will start memcached with 1GB memory on port 11211.
To check memcached stats use following command:
$ echo "stats" | nc localhost 11211
It will display some stats related to memcached.