2

I'm asking this here because I'm pretty sure it's a Linux issue.

I'm running Apache server locally on Ubuntu Server 12.10, which runs inside a virtual machine (VirtualBox) on Windows 7. The "www" directory is shared between the Ubuntu VM and my Windows OS, using VirtualBox's "Share Folder" facitility.

NOTE: It's basically a local directory in windows. In Ubuntu it gets automatically mounted on startup.

The server is also accessible from my Windows host via a URL like http://192.168.56.101/website1.

The thing is that images from that URL appear to be cached until I restart the virtual machine.

For example:

The URL http://192.168.56.101/website1/images/bg.png on the Apache server running on Ubuntu points to this file c:\www\website1\images\bg.png on the Windows share. In the Ubuntu VM it exists under /var/www/website1/images/bg.png.

If I modify this file in Photoshop in my Windows host, the changes are not seen in the Ubuntu server. I suspect that Linux caches the file or something, because after restarting the VM I'll seeing the updated image.

Is there any way I could disable caching for anything under the /var/www directory? Would this decrease performance or something?

7

Your problem sounds exactly like the one that's described here: Shared folder in VirtualBox for Apache

Try to add this setting to your Apache configuration:

EnableSendfile off
  • Issue from VB's forums: forums.virtualbox.org/viewtopic.php?f=3&t=33201 – slm Jan 28 '14 at 9:25
  • ok I've added that line to apache2.conf, restarted apache and now it works fine. I also tried the command you posted in the comments above and that works too, so it has something to do with the linux cache :D – Alex Jan 28 '14 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.