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?

Jeff Schaller
68.8k35 gold badges122 silver badges263 bronze badges
asked Jan 28, 2014 at 8:51
11
  • have you try Ctrl + F5 in your brother ? Commented Jan 28, 2014 at 9:01
  • well that's a rocky mistyping... browser is definitely the word I was looking for... anyway thanks for the answer it was pretty nice :D Commented Jan 28, 2014 at 9:11
  • 1
    Possibly related: stackoverflow.com/questions/6921670/… Commented Jan 28, 2014 at 9:19
  • 1
    This does sound exactly as described here: stackoverflow.com/questions/6298933/… Commented Jan 28, 2014 at 9:20
  • 1
    Yes I would agree, this is the best lead thus far: stackoverflow.com/questions/6298933/… Commented Jan 28, 2014 at 9:21

1 Answer 1

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
answered Jan 28, 2014 at 9:23
2
  • Issue from VB's forums: forums.virtualbox.org/viewtopic.php?f=3&t=33201 Commented Jan 28, 2014 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 Commented Jan 28, 2014 at 9:27

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.