Installing memcached on Ubuntu
:: Synopsis ::
Its a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.
:: Installation Procedure ::
You need the libevent dependencies in-order to install this package. Follow this method to install the required libraries. If you’ll try to install only the libevent then Ubuntu won’t let you install the libraries as libevent again needs its devel packages.
So, perform a full installation for all the libraries you must take help of wildcards here. Follow the below method:
[root @ oracle ~] # apt-get install libevent*
Then, configure your binaries and make files.
[user @ oracle ~] $ ./configure
[user @ oracle ~] $ make
[root @ oracle ~] # make install
Now it should install your memcached package successfully. To make sure that its properly installed you can check for the TCP Port 11211. Just use netstat and grep for 11211 tcp port port and it will show you the output whether your memcache daemon is running or not.
[user @ oracle ~] $ netstat –antp | grep 11211
NOTE: By default memcached should run after you install the package, but in case it doesn’t start automatically then do an updatedb first for your local repositories locations and then issue locate command.
[user @ oracle ~] $ sudo updatedb
[user @ oracle ~] $ locate –ir memcached
Now, it will show you the location of the existence of memcache daemon (memcached) related files. You should find your binary and daemon files under bin directory. From there the daemon can be directly initiated.
In case, if you want to know which version of the package you have installed then you can either issue memcached command with –h switch or you can do the check remotely by connecting to the remote IP Address and issuing version command. The syntax is as follows:
[user @ oracle ~ ] $ memcached –h
OR else if you want to check it remotely, then connect to that corresponding port, here (TCP 11211). The syntaxes are as follows:
$ telnet <IP_ADDR> <PORT>
Connected to <HOST_NAME>
Escape character is ‘^]’.
Output will be VERSION 1.x.x
Now you should be sure that your daemon is also running!
Then, to exit from there either issue quit command or press <Control + 5> and at the telnet prompt type quit to get back your normal shell.
NOTE: After you install, its better to issue “ldconfig” even though its not required always. effective!