1. Install pear (and the various libraries for pecl to install)
apt-get install php-pear php5-dev apache2-threaded-dev
2. Fix a silly name/version change problem with apxs by adding a symbolic link to the right file
ln -s /usr/bin/apxs2 /usr/bin/apxs
3. Install apc
pecl install apc
4. Make sure that php knows to use it... edit /etc/php/apache2/php.ini and add
5. Restart Apache and you're away!
Of course, try it out in your dev environment first... but it should yield significant benefits.
NB. In my dev environment this worked perfectly... but a pecl setting shut me down on 64 bit Ubuntu... complained during the installation at step 3... something like "Fatal error: Allowed memory size of 8388608 bytes exhausted..." for some reason it's using its own ini values... (not either the php.ini values for cli or apache).
If so... edit /usr/share/php/pearcmd.php and add: