Skip to content

Instantly share code, notes, and snippets.

@nghuuphuoc
Last active December 30, 2015 19:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nghuuphuoc/7876037 to your computer and use it in GitHub Desktop.
Save nghuuphuoc/7876037 to your computer and use it in GitHub Desktop.
Install Memcached on Centos 6
$ yum install memcached
// Configure Memcached
$ nano -w /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="512"
OPTIONS=""
// Set Memcached start when system starts
$ chkconfig --add memcached
$ chkconfig --levels 235 memcached on
// Commands:
// $ /etc/init.d/memcached start/stop/restart/status
$ nano -w /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 11211 -j ACCEPT
$ service iptables restart
// Check if the telnet command is available
$ which telnet
// If not, install it
// $ yum install telnet
// Clear memcache
$ telnet localhost 11211
flush_all
quit
// Install php memcache extension
$ yum --enablerepo=remi,remi-test install php-pecl-memcache
// Restart php-fpm
$ service php-fpm restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment