Install eAccelerator ( to accelerate for PHP )

One day I went to library and use the Internet. When connect to my website and found the reaction speed of the web page was slow and I probably waited for five seconds for loading completely. I thinks that if a foreign person to connect to my website and it must be more slow! Hence I want to accelerate my httpd and I found the eAccelerator. eAccelerator's installion and configure is very simple. I used the rpm method:( Tarball method can be found at nternet. So, I no longer illustrate with example. )

RPM:

Download rpm package from mysite ( FC6/httpd-2.3.3-5/PHP-5.1.6) or search from internet.

#wget http://acmevil.taes.tp.edu.tw/drupal/files/php-eaccelerator-5.1.6_0.9.5-1.fc6.i386.rpm

#rpm -Uvh php-eaccelerator-5.1.6_0.9.5-1.fc6.i386.rpm

Install done.

Configure: /etc/php.d/eaccelerator.ini

zend_extension="/usr/lib/php/modules/eaccelerator.so"
eaccelerator.shm_size = "16"
eaccelerator.cache_dir = "/var/cache/php-eaccelerator" eaccelerator.enable = "1"
eaccelerator.optimizer = "1"
eaccelerator.log_file = "/var/log/httpd/eaccelerator_log"
eaccelerator.name_space = ""
eaccelerator.check_mtime = "1"
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.keys = "shm_and_disk"
eaccelerator.sessions = "shm_and_disk"
eaccelerator.content = "shm_and_disk"
eaccelerator.allowed_admin_path = ""

Save it. Restart your httpd.

P.S: If you don't have /etc/php.d/eaccelerator.ini and you must add one.

eAccelerator also has web UI:

#cp /usr/share/doc/php-eaccelerator-5.1.6_0.9.5/*.php /your/web/root/eaccelerator

#$editor //your/web/root/eaccelerator/control.phpeaccelerator

Alter the usrname and password

/** config **/

$user = "admin";

$pw = "eAccelerator";

/** /config **/

Then connect http://ypur.domainname.com/eaccelerator/control.php


有一天我到圖書館上網。連到我的網站的時候,發現網頁的反應速度慢了一點,我大概等了五秒才全部開好。裡想,那如果是國外的人連到我的網站不就更慢了!於是就找到了eAccelerator。
eAccelerator的安裝非常簡單,尤其是用RPM這個方法:( Tarball 的方法在網路上容易找到,我就不再舉例說明。 )

RPM:

我的網站 ( FC6/httpd-2.3.3-5/PHP-5.1.6)下載rpm套件或從網路上搜尋適合您的版本。

#wget http://acmevil.taes.tp.edu.tw/drupal/files/php-eaccelerator-5.1.6_0.9.5-1.fc6.i386.rpm

#rpm -Uvh php-eaccelerator-5.1.6_0.9.5-1.fc6.i386.rpm

安裝完了!別懷疑,就這麼簡單!

設定 eaccelerator的設定檔: /etc/php.d/eaccelerator.ini (如果沒有php.d這個資料夾,就把設定檔加在php.ini裡或是新建一個資料夾來符合路徑位置。)

zend_extension="/usr/lib/php/modules/eaccelerator.so"
eaccelerator.shm_size = "16"
eaccelerator.cache_dir = "/var/cache/php-eaccelerator" eaccelerator.enable = "1"
eaccelerator.optimizer = "1"
eaccelerator.log_file = "/var/log/httpd/eaccelerator_log"
eaccelerator.name_space = ""
eaccelerator.check_mtime = "1"
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.keys = "shm_and_disk"
eaccelerator.sessions = "shm_and_disk"
eaccelerator.content = "shm_and_disk"
eaccelerator.allowed_admin_path = ""

存檔、重新啟動httpd(網頁伺服器)

收工、喝茶去~~~

等等,eAccelerator還有網頁介面的控制,你可以:

#cp /usr/share/doc/php-eaccelerator-5.1.6_0.9.5/*.php /your/web/root/eaccelerator

把php-eaccelerator的doc裡的所有*.php複製到網頁根目錄

#$editor //your/web/root/eaccelerator/control.php

修改control.php裡的帳號跟密碼

/** config **/

$user = "admin";

$pw = "eAccelerator";

/** /config **/

最後連上你control.php的URL就可以了!

喝茶去吧~~~ ^^

0 Responses