First, install the relevant library files required by the system before compiling the installation.
#yum-y install gcc gcc-c++ make cmake libtool autoconf Libaio
Two. Download the corresponding dependent library and memcached source package
1. Download the stable version of Libevent from http://libevent.org/
#wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
#wget http://www.memcached.org/files/memcached-1.5.0.tar.gz
2. Compile and install Libevent
#tar-ZXVF libevent-2.1.8-stable.tar.gz
#cd libevent-2.1.8-stable
#./configure--prefix=/usr/local/libevent
#make && make Install
Note: In the virtual machine under the practice of compiling, an easy-to-encounter problem, the virtual machine time is not right, resulting in the GCC compilation process detection time is not correct, has been in the process of compiling.
The workaround:
#date-S "Yyyy-mm-dd h:i:s"
#clock-W #把时间写入cmos
3. Compile and install Memcache
#tar-ZXVF memcached-1.5.0.tar.gz
#cd memcached-1.5.0
#./configure--prefix=/usr/local/memcached--with-libevent=/usr/local/libevent/#指定libevent的安装目录
#make && make Install
4. Start memched
#cd/usr/local/memcached/bin
#./memcached-m 64-p 11211-u nobody-d
This article is from the "Marks" blog, make sure to keep this source http://2477785.blog.51cto.com/2467785/1954329
Compile and install memcached under Linux