Memcached One-click installation Script V1.0

Source: Internet
Author: User
Tags exit memcached
#!/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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.