7/29/2008

Install eAccelerator on Centos 5.2

Still on pursuing to make a fast httpd server, I found eAccelerator at techiecorner.com. Here is what I gathered to install the eAccelerator on my Centos 5.2.

First lookup the latest PHP eAccelerator source distribution from here.
My downloaded version is eaccelerator-0.9.5.2.tar.bz2
Then:

$ tar -jxvf eaccelerator-0.9.5.2.tar.bz2
$ cd eaccelerator-0.9.5.2
$ phpize
$ ./configure
$ make
$ make install
after the last command, it shows this line:
Installing shared extensions: /usr/lib/php/modules/

Now we edit php.ini
$ nano /etc/php.ini
and add these line:

extension="eaccelerator.so"
eaccelerator.shm_size=”16″
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″

after saving the php.ini, I created temp folder for the eaccelerator

$ mkdir /tmp/eaccelerator
$ chmod 777 /tmp/eaccelerator

then restart the httpd:

$ httpd -k restart

to manage eAccelerator, I copied control.php
cp /usr/src/eaccelerator-0.9.5.2/control.php /path/to/my/homepage/control.php
when I tried to browse http://comp1/control.php, it asked for password, the default is :

Username : admin
Password : eAccelerator

but then I got "This script isn't in the allowed_admin_path setting" error in some area of the page. After took a peak on my ubuntu server configuration that already running eAccelerator, I added "eaccelerator.allowed_admin_path="/path/to/my/homepage"" so my php.ini now look like this :

extension="eaccelerator.so"
eaccelerator.shm_size="16"
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.allowed_admin_path="/path/to/my/homepage"


save the php.ini, then restart the httpd:

$ httpd -k restart

now I can login and manage the eAccelerator

No comments: