How to fix the caching problems with VirtualBox folder sharing + Apache
We are using a common VirtualBox image for the development of our graduation project. The files reside in our own computer, so the virtual instance only runs the Apache, which pulls the files from our computer and executes them. So for Apache, the files it serves appear to be mounted with NFS (that’s the way virtual systems represent folder sharing)
While a brilliant idea, this led to very strange caching problems. For one, the CSS files I was writing weren’t getting updated. If I put a lot of stuff in a CSS file which is already cached, it would spit out other PHP code in our project!
A few days of confusion and a fellow blogger has the result. So go to the configuration file of your Apache instance in the virtual image and add these two bold lines.
<Directory “/var/www/public_html/”>
Options Indexes FollowSymLinks ExecCGI MultiViews
AllowOverride All
Order allow,deny
allow from all
EnableMMAP Off
EnableSendfile Off
</Directory>
This is a supposed to be a performance-improving default setting, but not very useful for development environments, and especially when the NFS-mounted files are actually on the same computer.
Comments