4

Debian安装Xcache、eaccelerator

   Posted by: 等待一生   in Web Server

刚刚写了关于 Debian aptget 安装Apache 、PHP 、MySQL等等,但Xcache、eaccelerator一直没有办法安装,刚刚无意间看到网上的一些资料,试了下,居然成功了- - 记录下来~备用~

注:尽可能按照Xcache、Zend、eaccelerator 这个顺序安装,否则Zend可能会失效。

安装Debian解压缩软件

apt-get install unzip

安装PHP组件

apt-get install php5-dev

1,先安装xcache:

cd /usr/local/src
wget http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz
tar zxvf xcache-1.2.2.tar.gz
cd xcache-1.2.2
phpize
./configure --enable-xcache --enable-xcache-coverager --enable-inline-optimization --disable-debug
make && make install

make install后,会显示.so文件的路径:“/usr/lib/php5/20060613+lfs/” 记录下来,之后需要。

修改php.ini文件,最后加入以下代码:

[xcache-common]
zend_extension = /usr/lib/php5/20060613+lfs/xcache.so     //刚才记录下的路径

[xcache.admin]
xcache.admin.user = "admin"
; xcache.admin.pass = md5($这里输入密码)
xcache.admin.pass = "在此输入密码的md5 32位值"

[xcache]
xcache.cacher = On
xcache.shm_scheme = "mmap"
xcache.size = 32M
; cpu number (cat /proc/cpuinfo |grep -c processor)
xcache.count = 2
xcache.slots = 8k
xcache.ttl = 0
xcache.gc_interval = 0
xcache.var_size = 2M
; cpu number (cat /proc/cpuinfo |grep -c processor)
xcache.var_count = 4
xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.readonly_protection = Off
xcache.mmap_path = "/dev/zero"

xcache.size = 32M //给予64M的缓存
xcache.count = 4 //四核的CPU(视情况,可以删除)

修改/etc/php.d/xcache.ini文件,主要是修改这几个选项,其它用默认值即可。
xcache.size = 32M
xcache.count = 4
给予32M的缓存,四核的CPU。

再查找

output_buffering = Off

修改为

output_buffering = On

2,安装Zend

cd /usr/local/src
wget http://downloads.zend.com/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
tar xzvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
./ZendOptimizer-3.3.3-linux-glibc23-i386/install.sh

按照它的提示一步步进行就行了。

3,安装eaccelerator

wget http://bart.eaccelerator.net/source/0.9.5.3/eaccelerator-0.9.5.3.zip
unzip eaccelerator-0.9.5.3.zip
cd eaccelerator-0.9.5.3
phpize
./configure --enable-eaccelerator=shared
make && make install

再次修改php.ini文件,最后加入以下代码:

extension=eaccelerator.so
[eaccelerator]
eaccelerator.shm_size=32
eaccelerator.cache_dir=/tmp/eaccelerator
eaccelerator.enable=1
eaccelerator.optimizer=1
eaccelerator.check_mtime=1
eaccelerator.debug=0
eaccelerator.filter=
eaccelerator.shm_max=0
eaccelerator.shm_ttl=0
eaccelerator.shm_prune_period=0
eaccelerator.shm_only=0
eaccelerator.compress=1
eaccelerator.compress_level=9

接着为eAccelerator创建一个临时缓冲目录,这里我们定义为/tmp/eaccelerator,并保持这个目录可写!

mkdir /tmp/eaccelerator
chmod 777 /tmp/eaccelerator

好了,打工告成~现在可以查看phpinfo.php,是不是都有显示了?

4,在这里顺便提一下:之前安装过sock5服务器ss5,但有点小问题,这里提一下:

安装更新:

cd /usr/local/src
wget http://jaist.dl.sourceforge.net/sourceforge/ss5/ss5-3.6.4-3.tar.gz
tar -zxf ss5-3.6.4-3.tar.gz
cd ss5-3.6.4
./configure --prefix=/usr --with-defaultport=1080 (修改默认端口)
make&&make install

启动的时候,socks4也会随着更新,为了避免非法用户登录,进入/usr/lib/ss5目录,将mod_socks4.so重命名为mod_socks4.so.bak 或者输入以下代码:

cd /usr/lib/ss5
mv mod_socks4.so mod_socks4.so.bak

现在好了~收工~~~

066

鸣谢ujj提供技术参考,下次有问题我会继续当面骚扰的~不客气~~

Related posts:

  1. Ubuntu 9.10安装Apache 2 + PHP 5 + MySQL 5.1 (Linode篇)
  2. 关于PHP 5.3的安装步骤
  3. Linux VPS安装AMP (Apache+MySQL+PHP)
  4. Ubuntu 9.04 编译安装Apache 2.2.12+MySQL 5.1.37+PHP 5.2.10
  5. Debian安装Apache2+MySQL5+PHP5
  6. Ubuntu 9.10 安装PHP-ACP、Memcached优化组件
  7. VPS 学习笔记 - Debian WEB服务器架设篇
  8. Debian Apache2.2配置FastCGI(fcgid)
  9. Debian实现高负载WEB动态页面与静态页面的分离
  10. CentOS 5安装和配置sock5服务器ss5

Tags: , , , ,

发表评论之余,您还可以到寂静街论坛与我们一起讨论您的观点哦。

This entry was posted on 星期六, 七月 4th, 2009 at 8:25 下午 and is filed under Web Server. You can follow any responses to this entry through the RSS 2.0 feed.You can leave a response, or trackback from your own site.

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment