#!/bin/bash #author Itnihao #version 1.0 #date 2012-08-04 #mail itnihao@qq.com # www.bianceng.cn #s Ource http://code.google.com/p/auto-task-pe/green= ' \e[0;32m ' red= ' \e[0;31m ' blue= ' \e[0;36m ' blue1= ' \e[5;31m ' nc= ' \e[0m ' soft_path=$ (pwd) libevent_version=libevent-2.0.19-stable.tar.gz memcached_version=memcached-1 .4.13.tar.gz libevent_url=https://github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz memcached _url=http://memcached.googlecode.com/files/memcached-1.4.13.tar.gz function Install_libevent {c D ${soft_path} [!-e ${libevent_version}];
Stats=$? [$stats = = 0] && echo-e "${red} There are not ${libevent_version} file${nc}" && wget--no-check-certif
Icate ${libevent_url} tar zxvf ${libevent_version} CD $ (echo $libevent _version|sed "s/.tar.gz//g")./configure ["$?"!= 0] && echo-e "${red}configure libevent error,please CHECK${NC' && exit 1 make [$? '!= 0] && echo-e ' ${red} make libevent error,please check${nc} '
;& exit 1 Make install;stats=$? ["$stats"!= 0] && echo-e "${red}make install libevent error,please CHECK${NC}" && exit 1 ["$stats ' = = 0] && echo-e ' ${green}install ${libevent_version} ' is Ok........${nc} ' function Install_memca
Ched {CD ${soft_path} echo ${soft_path} [!-e ${memcached_version}];stats=$? [$stats = = 0] && echo-e "${red} There are not ${memcached_version} file${nc}" && wget ${memcached_url The Tar xvf ${memcached_version} CD $ (echo $memcached _version|sed "s/.tar.gz//g")./configure ["$?"!= 0] && echo-e "${red}configure memcached error,please Check${nc}" && exit 1 Make ["$?"!= 0] &
& Echo-e ' ${red} make memcached error,please check${nc} ' && exit 1 make install;stats=$? ["$stats"!=0] && echo-e "${red}make install memcached error,please CHECK${NC}" && exit 1 ["$stats" = = 0]
;& echo-e "${green}install ${memcached_version} is OK........${NC}" echo "/usr/local/lib" >>/etc/ld.so.conf Ldconfig/usr/local/bin/memcached-m 32m-p 11211-d-u root-p/var/run/memcached.pid-c 1024 "ECHO-E}" Now,memcached is running and used this command \/usr/local/bin/memcached-m 32m-p 11211-d-u root-p/var/run/memcache D.pid-c 1024 "\${nc}"} install_libevent install_memcached
Rhel5. Both X and 6.X tests are carried out, provided that components such as GCC are installed.
If you have any questions, please leave a message
This article comes from "Itnihao Technology blog" blog, please be sure to keep this source http://itnihao.blog.51cto.com/1741976/954041