Hello,
I've created a little script that enables the well known APC accelerator in Kloxo-MR installations, this is currently deployed in every production server we run. I hope you find it useful, the performance gain is very noticeable, on most sites, page load speed is 40% better! (sites tested were based on Wordpress & Joomla).
This is meant for CentOS 6.x, Kloxo-MR Final Release with PHP 5.3u, Apache and PHP-FPM , although it should be pretty much the same for PHP 5.4#!/bin/bash
#
# KimeraLive APC installer
#
echo ""
echo "Kimera APC installer v0.7 BETA for Kloxo-MR "
echo ""
echo "installing required packages and removing unwanted..."
echo ""
yum clean all
yum remove php53u-xcache -y
yum install php53u-devel -y
pecl channel-update pecl.php.net
echo ""
echo "installing APC extension..."
echo ""
pecl install apc
echo "extension = apc.so" > /etc/php.d/apc.ini
echo "apc.shm_size = 96M" >> /etc/php.d/apc.ini
echo "apc.stat = 0" >> /etc/php.d/apc.ini
echo ""
echo "cleaning up..."
echo ""
yum remove php53u-devel -y
echo "done."
echo ""
echo "restart web server & php-fpm to apply!"
echo ""
- APC will ask a few questions, leave the default answer unless you know what you're doing! -
Note1: you may not want to remove php53u-devel on your server.
Note2: I find the value "apc.shm_size = 96M" to be adequate on our servers, but feel free to adjust as needed.
Finally, to test the behavior of APC, you can copy the apc.php file to the kloxo default root:
cp /usr/share/pear/apc.php /home/kloxo/httpd/default/
and then go to:
http://IP_ADDRESS/apc.soHigh number of hits (more green) means APC is doing its caching job properly. Let it run for at least 12 hours to get some traffic on it and thus a more realistic feedback.