查看: 413|回复: 2

Memcache服务器

 关闭 [复制链接]

签到天数: 2090 天

连续签到: 2 天

[LV.Master]伴坛终老IIII

发表于 2009-5-9 17:39 | 显示全部楼层 |阅读模式
Memcache服务器




###安装Memcache服务器端###
##libevent官网:http://www.monkey.org/~provos/libevent/
cd /opt/distfiles
wget -c http://monkey.org/~provos/libevent-1.4.5-stable.tar.gz
tar zxvf libevent-1.4.5-stable.tar.gz
cd libevent-1.4.5-stable
./configure --prefix=/usr/local/libevent
make && make install
##memcached官网: http://danga.com/memcached/
cd /opt/distfiles
wget -c http://danga.com/memcached/dist/memcached-1.2.5.tar.gz
tar zxvf memcached-1.2.5.tar.gz
cd memcached-1.2.5
./configure --prefix=/usr/local/memcache --with-libevent=/usr/local/libevent
make && make install

##启动memcached服务
/usr/local/memcache/bin/memcached -d -m 100-u root -p 12000 -c 256 -P /tmp/memcached.pid

###注意:运行\"/usr/local/memcache/bin/memcached \"时有类似以下错误提示
/usr/local/memcache/bin/memcached : error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory
##64位系统解决办法:
ln -s /usr/local/libevent/lib/libevent-1.4.so.2 /usr/lib64/libevent-1.4.so.2
##32位系统解决办法:
ln -s /usr/local/libevent/lib/libevent-1.4.so.2 /usr/lib/libevent-1.4.so.2

###安装Memcache的PHP扩展###
##PECL官网:http://pecl.php.net
cd /opt/distfiles
wget -c http://pecl.php.net/get/memcache-2.2.3.tgz
tar zxvf memcache-2.2.3.tgz
cd memcache-2.2.3
/opt/modules/phpcgi/bin/phpize
##注意:如果运行后有以下错误提示,需要安装autoconf automake,apt-get install autoconf automake
/opt/modules/phpcgi/bin/phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No:20060613
Zend Extension Api No: 220060519
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script.

./configure --enable-memcache --with-zlib-dir --with-php-config=/opt/modules/phpcgi/bin/php-config
make && make install
##配置php.ini
vi /opt/modules/phpcgi/lib/php.ini
将extension_dir = \"./\" 修改为 extension_dir = \"/opt/modules/phpcgi/lib/php/extensions/no-debug-non-zts-20060613\"
然后在下面添加:
extension=\"memcache.so\"
##重起web服务查看info.php memcached是否加载

###memcachedb安装
wget -c http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz
cd db-4.7.25/build_unix
../dist/configure
make && make install
#将Berkeley Db运行库的路径添加到系统配置里面
echo \"/usr/local/BerkeleyDB.4.7/lib/\" >> /etc/ld.so.conf
#重载系统Ld运行库
ldconfig

cd /opt/distfiles
wget -c http://memcachedb.googlecode.com/files/memcachedb-1.0.3.tar.gz
tar zxvf memcachedb-1.0.3.tar.gz
cd memcachedb-1.0.3
./configure --with-libevent=/usr/local/libevent --with-bdb=/usr/local/BerkeleyDB.4.7
PCOS系统下载站:http://zhuangji.wang

签到天数: 2090 天

连续签到: 2 天

[LV.Master]伴坛终老IIII

 楼主| 发表于 2009-5-9 17:39 | 显示全部楼层

Memcache服务器

Memcache服务器




###安装Memcache服务器端###
##libevent官网:http://www.monkey.org/~provos/libevent/
cd /opt/distfiles
wget -c http://monkey.org/~provos/libevent-1.4.5-stable.tar.gz
tar zxvf libevent-1.4.5-stable.tar.gz
cd libevent-1.4.5-stable
./configure --prefix=/usr/local/libevent
make && make install
##memcached官网: http://danga.com/memcached/
cd /opt/distfiles
wget -c http://danga.com/memcached/dist/memcached-1.2.5.tar.gz
tar zxvf memcached-1.2.5.tar.gz
cd memcached-1.2.5
./configure --prefix=/usr/local/memcache --with-libevent=/usr/local/libevent
make && make install

##启动memcached服务
/usr/local/memcache/bin/memcached -d -m 100-u root -p 12000 -c 256 -P /tmp/memcached.pid

###注意:运行\"/usr/local/memcache/bin/memcached \"时有类似以下错误提示
/usr/local/memcache/bin/memcached : error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory
##64位系统解决办法:
ln -s /usr/local/libevent/lib/libevent-1.4.so.2 /usr/lib64/libevent-1.4.so.2
##32位系统解决办法:
ln -s /usr/local/libevent/lib/libevent-1.4.so.2 /usr/lib/libevent-1.4.so.2

###安装Memcache的PHP扩展###
##PECL官网:http://pecl.php.net
cd /opt/distfiles
wget -c http://pecl.php.net/get/memcache-2.2.3.tgz
tar zxvf memcache-2.2.3.tgz
cd memcache-2.2.3
/opt/modules/phpcgi/bin/phpize
##注意:如果运行后有以下错误提示,需要安装autoconf automake,apt-get install autoconf automake
/opt/modules/phpcgi/bin/phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No:20060613
Zend Extension Api No: 220060519
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script.

./configure --enable-memcache --with-zlib-dir --with-php-config=/opt/modules/phpcgi/bin/php-config
make && make install
##配置php.ini
vi /opt/modules/phpcgi/lib/php.ini
将extension_dir = \"./\" 修改为 extension_dir = \"/opt/modules/phpcgi/lib/php/extensions/no-debug-non-zts-20060613\"
然后在下面添加:
extension=\"memcache.so\"
##重起web服务查看info.php memcached是否加载

###memcachedb安装
wget -c http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz
cd db-4.7.25/build_unix
../dist/configure
make && make install
#将Berkeley Db运行库的路径添加到系统配置里面
echo \"/usr/local/BerkeleyDB.4.7/lib/\" >> /etc/ld.so.conf
#重载系统Ld运行库
ldconfig

cd /opt/distfiles
wget -c http://memcachedb.googlecode.com/files/memcachedb-1.0.3.tar.gz
tar zxvf memcachedb-1.0.3.tar.gz
cd memcachedb-1.0.3
./configure --with-libevent=/usr/local/libevent --with-bdb=/usr/local/BerkeleyDB.4.7
PCOS系统下载站:http://zhuangji.wang

签到天数: 2090 天

连续签到: 2 天

[LV.Master]伴坛终老IIII

 楼主| 发表于 2009-5-9 17:39 | 显示全部楼层

Memcache服务器

Memcache服务器




###安装Memcache服务器端###
##libevent官网:http://www.monkey.org/~provos/libevent/
cd /opt/distfiles
wget -c http://monkey.org/~provos/libevent-1.4.5-stable.tar.gz
tar zxvf libevent-1.4.5-stable.tar.gz
cd libevent-1.4.5-stable
./configure --prefix=/usr/local/libevent
make && make install
##memcached官网: http://danga.com/memcached/
cd /opt/distfiles
wget -c http://danga.com/memcached/dist/memcached-1.2.5.tar.gz
tar zxvf memcached-1.2.5.tar.gz
cd memcached-1.2.5
./configure --prefix=/usr/local/memcache --with-libevent=/usr/local/libevent
make && make install

##启动memcached服务
/usr/local/memcache/bin/memcached -d -m 100-u root -p 12000 -c 256 -P /tmp/memcached.pid

###注意:运行\"/usr/local/memcache/bin/memcached \"时有类似以下错误提示
/usr/local/memcache/bin/memcached : error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory
##64位系统解决办法:
ln -s /usr/local/libevent/lib/libevent-1.4.so.2 /usr/lib64/libevent-1.4.so.2
##32位系统解决办法:
ln -s /usr/local/libevent/lib/libevent-1.4.so.2 /usr/lib/libevent-1.4.so.2

###安装Memcache的PHP扩展###
##PECL官网:http://pecl.php.net
cd /opt/distfiles
wget -c http://pecl.php.net/get/memcache-2.2.3.tgz
tar zxvf memcache-2.2.3.tgz
cd memcache-2.2.3
/opt/modules/phpcgi/bin/phpize
##注意:如果运行后有以下错误提示,需要安装autoconf automake,apt-get install autoconf automake
/opt/modules/phpcgi/bin/phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No:20060613
Zend Extension Api No: 220060519
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script.

./configure --enable-memcache --with-zlib-dir --with-php-config=/opt/modules/phpcgi/bin/php-config
make && make install
##配置php.ini
vi /opt/modules/phpcgi/lib/php.ini
将extension_dir = \"./\" 修改为 extension_dir = \"/opt/modules/phpcgi/lib/php/extensions/no-debug-non-zts-20060613\"
然后在下面添加:
extension=\"memcache.so\"
##重起web服务查看info.php memcached是否加载

###memcachedb安装
wget -c http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz
cd db-4.7.25/build_unix
../dist/configure
make && make install
#将Berkeley Db运行库的路径添加到系统配置里面
echo \"/usr/local/BerkeleyDB.4.7/lib/\" >> /etc/ld.so.conf
#重载系统Ld运行库
ldconfig

cd /opt/distfiles
wget -c http://memcachedb.googlecode.com/files/memcachedb-1.0.3.tar.gz
tar zxvf memcachedb-1.0.3.tar.gz
cd memcachedb-1.0.3
./configure --with-libevent=/usr/local/libevent --with-bdb=/usr/local/BerkeleyDB.4.7
PCOS系统下载站:http://zhuangji.wang

本版积分规则