Install memcached on CentOS 5 and 6
Install memcached on CentOS 5 and 6
Yesterday I had to install memcached on a VPS server for a client which, what he said, was especially needed for his application. For those who don’t know, memcached is a high performance distributed memory object caching system, like its name, it is using your ram memory, speeding up dinamic web applications by reducing the database workload.
I will try to explain for both CentOS 5 and 6 here, so follow the steps carefully.
- Installing memcached on your server first
For CentOS 5.X i386 / i686 please import and install the follow yum repo:
1 |
rpm -Uhv http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm |
For CentOS 5.X x86_64 please import and install the follow yum repo:
1 |
rpm -Uhv http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm |
For CentOS 6.X i386 / i686 please import and install the follow yum repo:
1 |
rpm -Uhv http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm |
For CentOS 6.X x86_64 please import and install the follow yum repo:
1 |
rpm -Uhv http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm |
Then install memcached using yum:
1 |
yum install memcached |
The settings for this software can be found here /etc/sysconfig/memcached
1 2 3 4 5 |
PORT="11211" USER="nobody" MAXCONN="1024" CACHESIZE="64" OPTIONS="" |
After making changes to this file save it and you’re done.
Then you just need start the service running:
1 |
/etc/init.d/memcached start |
And that is all, you now need to install php memcached extension which will be another article now.