>cd /root/software
>wget http://memcached.org/latest
>tar -zxvf latest
>cd memcached-1.4.20
>./configure --with-libevent=/usr && make && make test && sudo make install
然后提示找不到libevent
>yum install libevent
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Setting up Install Process
Package libevent-1.4.13-4.el6.x86_64 already installed and latest version
Nothing to do
于是前往下载libevent.org自行下载
>cd /root/software
>wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
>tar -zxvf libevent-2.0.21-stable.tar.gz
>cd libevent-2.0.21-stable
>./configure && make && make install
>cd /root/software/memcached-1.4.20
>./configure --with-libevent=/usr && make && make test && sudo make install
./timedrun: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
又提示错误了,应该是缺少符号链接了
>ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
>./configure --with-libevent=/usr && make && make test && sudo make install
make: prove: Command not found
依然有错误,Google一下,再安装一个
>yum install perl-Test-Harness
>./configure --with-libevent=/usr && make && make test && sudo make install
还是有错误,错误很长,就不贴了,继续打两个perl包
>yum install perl-CPAN
>yum install perl-Test-Simple
>./configure --with-libevent=/usr && make && make test && sudo make install
t/whitespace.t ....... skipped: Skipping tests probably because you don't have git.
Test Summary Report
-------------------
t/expirations.t (Wstat: 256 Tests: 15 Failed: 1)
Failed test: 2
Non-zero exit status: 1
Files=49, Tests=7074, 110 wallclock secs ( 1.54 usr 0.17 sys + 5.36 cusr 1.47 csys = 8.54 CPU)
Result: FAIL
make: *** [test] Error 1
很不顺利。
>yum install git
>./configure --with-libevent=/usr && make && make test && sudo make install
终于成功了!!!加入启动项
>vim /etc/rc.d/rc.local
#末尾加入
/usr/local/bin/memcached -d -m 256 -p 11215 -u root -l 127.0.0.1
>:wq