memcached服务器和客户端脚本安装

memcached服务器端
 
#!/bin/bash
 
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype
 yum -y install freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel
 yum -y install bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5
 yum -y install krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap
 yum -y install openldap-clients openldap-servers ntpd nmap patch cmake bison cgi* libtool-* gettext
 yum -y install *libxml-devel libcurl-devel libevent libevent-devel net-snmp-devel lsof unzip
 
cd /mydata/soft/
 tar -zxvf libevent-1.4.13-stable.tar.gz
 cd libevent-1.4.13-stable
 ./configure --prefix=/usr
 make && make install
 ls -al /usr/lib|grep libevent
 
cd /mydata/soft/
 tar -zxvf memcached-1.4.5.tar.gz
 cd memcached-1.4.5
 ./configure --with-libevent=/usr
 make && make install
 ls -al /usr/local/bin/mem*
 
##标红的地方可自行修改
 
memcached客户端
 
#!/bin/bash
 cd /mydata/soft/
 tar -zxvf memcache-2.2.5.tgz
 cd memcache-2.2.5
 /usr/local/php/bin/phpize
 ./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir
 make && make install
 
cd /usr/local/php/etc/php.d
 touch /usr/local/php/etc/php.d/memcache.ini
 echo "extension = \"memcache.so\"" >> /usr/local/php/etc/php.d/memcache.ini
 echo "memcache.chunk_size = 32768" >> /usr/local/php/etc/php.d/memcache.ini
 
 
##标红的地方可自行修改
 
启动服务
 
memcached -d -m 2048 -u root -l IP -p 11211 -c 3096 -P /tmp/memcached.pid

相关推荐