Disable APC in Linux For Individual Website

Written by Allen White on. Posted in Linux, VPS, Web

Being a complete amateur in in web design, when the servers that Techieshelp.com are hosted on were built then they had APC caching installed with all the default settings on. This means that any websites that are hosted on these servers use the default settings.

APC is great and has sped up this website greatly as WordPress in ran on PHP, however on a new project that im testing I had issues with APC and needed to find a way of disabling APC for an individual website. There are two ways we can do this, first the method that most people should be able to do with very little technical knowledge.

Disable APC in HTAccess

We can disable APC on a website bit simply editing the .htaccess with the following line of code.

php_flag apc.cache_by_default Off

disable APC for website

With this method websites can be enabled or disabled even if APC is enabled by default, the command to enable APC is.

php_flag apc.cache_by_default On

Filter Folders APC Caches

The next method enables us to exclude folders that APC will cached. To do so add the following line to your APC.ini

apc.filters = "-/usr/var/www/mywebsitee/.*"

Basically replace the path above with the full path to your website. This tells APC to ignore the folder structure you have specified. Before the above takes effect thought we must restart Apache.

service apache2 restart


Allen White
Allen is a Consultant for ITPS in the North East of England and holds the following accreditations. MCSA, MCSE, MCTS, MCITP, CCA, CCSP, VCP 4,5 and HP ASE, AIS - Network Infrastructure.

ITPS provides strategic IT consultancy, implementation, data centre provision and unified communications, as well as support services and workspace and disaster recovery. If you require a consultation then please contact me via the contacts section or direct on 07931222991, add me on linkedin. https://uk.linkedin.com/in/allenwhiteconsultant0001

Tags: , ,

Leave a comment


(c) Techieshelp.com. Please be aware, all information is provided freely, any information used is done so at your risk and Techieshelp will not be held responsible for any issue that may occur.
!-- BuySellAds On-Site Shopping Cart -->