My host machine is ArchLinux and I'm running Apache in a CentOS guest. I have the vhost configuration and all the site code in a shared folder. To be able to put the vhost configuration in a shared folder I mounted the shared folder as apache:apache.
shared /mnt/shared vboxsf defaults,uid=48,gid=48 0 0
When I'm editing files in the host, Apache will consistently start sending old versions of the file with trailing characters. In vim, they show up as ^@, so I guess they're null characters. The number of null characters is related to the number of changes I make even if I edit the first line, null characters show up at the end. If I were to speculate, it looks like a bad diff.
If I stop httpd
, umount
, remount, and start httpd
the file looks fine. Just restarting httpd doesn't help.
How would I go about debugging the mount? Nothing jumped out at me in /var/log
.
To share a host folder with a virtual machine in Oracle VM VirtualBox, you must specify the path of the folder and choose a share name that the guest can use to access the shared folder. This happens on the host. In the guest you can then use the share name to connect to it and access files.
I was wrong; it was happening elsewhere but I noticed that it was only with .css and .js files. A search led me to this post which talks about a problem with vboxsf and small files.
The solution is to set, in Apache
EnableSendfile off
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With