first, the installation of GCC
# yum-y Install GCC
Second, installation libevent
# wget http://www.monkey.org/~provos/libevent-2.0.12-stable.tar.gz
# tar zxf libevent-2.0.12-stable.tar.gz
# CD Libevent-2.0.12-stable
#./configure --prefix=/usr/local/lib
# make && make install
Third, install make
# yum-y Install make
Iv. Download and install the latest version: Http://memcached.org/downloads
# wget http://memcached.org/files/memcached-1.4.20.tar.gz
# CD memcached-1.4.20
#./configure--prefix=/usr/local/memcached--with-libevent=/usr/local/lib && make && make install
V. Configuration startup
# vi/etc/rc.local
#!/bin/sh
#
# This script is executed *after* all and the other init scripts.
# can put your own initialization stuff in here if you don ' t
# want to does the full Sys V style init stuff.
Touch/var/lock/subsys/local
/usr/sbin/ntpdate ntpupdate.tencentyun.com >/dev/null 2>&1 &
/usr/local/agenttools/agent/startagent.sh/usr/local/agenttools/agent/dev/null
#secu-tcs-agent Bootstart, install at Tue APR 17:21:38 CST 2014.
/usr/local/sa/agent/secu-tcs-agent-mon-safe.sh >/dev/null 2>&1
/usr/local/memcached/bin/memcached-p 12677-u 0-d-r-u root-m 2040-c 1024-t 4
Quit after saving, start service manually
#/usr/local/memcached/bin/memcached-p 12677-u 0-d-r-u root-m 2040-c 1024-t 4
Note: If the/usr/local/memcached/bin/memcached:error while loading shared libraries:libevent-2.0.so.5:cannot open shared Object File:no such file or directory exception in/etc/ld.so.conf add/usr/local/lib this line, save, then run:/sbin/ldconfig–v update the configuration.
# vi/etc/ld.so.conf
#/sbin/ldconfig-v
VI. Test memcached
# telnet 127.0.0.1 12677
The following message appears indicating a successful start
Trying 127.0.0.1 ...
Connected to 127.0.0.1.
Escape character is ' ^] '.