Mint statsI like stats. We all like stats in some form or other. It brings order to often disorganised information.
My website has been taking a lot of hits recently, far over the normal amount of traffic I get. To the left should show that quite clearly.

Bus statsAll of those extra hits have been for one particular post I made. Hampshire police bus. As you can see to the right, I’ve had close to 10,000 hits just for that post.

Apc has been taking a lot of weight off the shoulders of my server (1.24 million hits!). Admittedly, my server doesn’t just host my website, but several other popular websites too. The user cache variables are from my websites only though.

APC stats

I’m pretty thankful I run APC, mod_deflate and WP Super Cache. Without any of these my server would probably be struggling. I’d also recommend the WordPress APC object cache for those who use WordPress and have APC installed.


Litespeed LogoI decided to take the plunge and get rid of Apache for something with a smaller footprint and twice the power: Litespeed.
I got a little tired of having to constantly monitor apache as it frequently took up too much memory and affected other services. Sometimes this resulted in my VPS having services killed off for too much memory usage by Virtuozzo.

As I write this, Litespeed is currently running at 14.4MB RAM usage and 0.1% CPU usage. Compare that to Apache swallowing a whopping 80MB+ or RAM, not to mention CPU time you can probably see why switching over to Litespeed is a good idea!
The main selling point of Litespeed for me was the easy replacement of Apache on a WHM/cPanel server. It’s very easy to configure Litespeed to utilise the Apache configuration files that WHM/cPanel writes to. This has the benefit of being fully integrated into the custom tools that WHM and cPanel use in their respective control panels.

Here’s a very quick guide on how to install it.

wget http://litespeedtech.com/packages/3.0/lsws-3.3-std-i386-linux.tar.gz
tar -xvfz lsws-3.3-std-i386-linux.tar.gz
cd lsws*
./install.sh

Once you’ve run through the configuration interface you can now setup Litespeed to load the Apache configuration file. Login through the new administration interface and click Configuration -> Server. Change the following.

Load Apache Configuration => Yes
Auto Reload On Changes    => Yes
Apache Configuration File => /usr/local/apache/conf/httpd.conf
Apache Port Offset  => 2000

You do have the option to enable PHP suEXEC for additional security, although if you enable this you won’t be able to use an opcode cache like APC.

Once you’ve made sure that Litespeed is functioning correctly, you can go back to the above configuration and change the Apache Port Offset to 0 and then disable Apache.
For more thorough guides on how to setup Litespeed and a custom PHP install, I’d suggest visiting Litespeed Install and Litespeed custom PHP.


I’ve lost count how many times I’ve needed to recompile a new version of APC for PHP on my server, so this mainly serves as a reminder on how to do it for next time.

  1. Go to http://pecl.php.net/package/APC and find the latest download link at the time.
  2. Login via SSH and go into root login via
    su -
  3. Navigate to the source folder:
    cd /usr/local/src
  4. wget the latest download from the PHP pecl link above. (i.e. wget http://pecl.php.net/get/APC-3.0.15.tgz)
  5. Unzip the archive like so:
    gunzip -c APC-3.0.15.tgz | tar xf -
  6. Navigate to the APC folder:
    cd APC-3.0.15
  7. phpize the APC folder to make the correct configuration file: /usr/bin/phpize
  8. Make the configuration file:
    ./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/bin/php-config
  9. Start the compile:
    make
  10. Finish and install:
    make install
  11. Edit the php.ini file to enable the APC module based on the location provided from the previous command:
    pico -w /usr/lib/php.ini
  12. Finally restart apache to see the changes:
    service httpd restart

The important bits you need to put inside php.ini are the extension call like so:

extension = "apc.so"

You then also need to enable and configure APC to your liking. Here’s my setup:

apc.enabled = 1
apc.shm_size = 64
apc.ttl = 3600
apc.user_ttl = 3600
apc.optimization = 0
apc.filters = "-Gallery.*\.class, wp-cache-config, -mint.php"
apc.include_once_override=1
apc.write_lock=1

Other things you need to take into account is your PHP extension_dir setting. This needs to be set right to be able to load the module correctly above.
You should also bear in mind that /usr/bin/phpize and /usr/bin/php-config could be different for your system setup.


Today I went ahead and updated PHP and APC to the latest versions. Unfortunately, WordPress and some of its plugins don’t seem to agree too well with either of them.
I rolled back to PHP 5.2.0 and APC 3.0.12p2 for the time being and will keep an eye on the software to see if any changes are made soon.
I did managed to get Suhosin installed though.

lotsa emails this way!