Last active
December 30, 2015 19:39
-
-
Save nghuuphuoc/7876037 to your computer and use it in GitHub Desktop.
Install Memcached on Centos 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ nano -w /etc/sysconfig/iptables | |
-A INPUT -m state --state NEW -m tcp -p tcp --dport 11211 -j ACCEPT | |
$ service iptables restart | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check if the telnet command is available | |
$ which telnet | |
// If not, install it | |
// $ yum install telnet | |
// Clear memcache | |
$ telnet localhost 11211 | |
flush_all | |
quit | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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