共享文件夹在VirtualBox中的Apache [英] Shared folder in VirtualBox for Apache
问题描述
我的主机是ArchLinux的,我在一台CentOS客运行Apache。我有一个共享文件夹中的虚拟主机配置和所有站点code。为了能够把虚拟主机配置,我登上了共享文件夹作为Apache的共享文件夹:阿帕奇
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
当我在主机编辑文件,Apache将始终如一地开始发送文件的旧版本尾随字符。在vim中,他们显示为^ @,所以我想他们是空字符。的空字符数是关系到我的变化的数量使即使我编辑的第一线,空字符结尾出现。如果我猜测,它看起来像一个坏的差异。
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.
如果我停止的httpd
,的umount
,重新装载,并启动的httpd
文件看起来很好。刚刚重启httpd,于事无补。
If I stop httpd
, umount
, remount, and start httpd
the file looks fine. Just restarting httpd doesn't help.
我会如何调试安装?没有在我跳出的/ var /日志
。
How would I go about debugging the mount? Nothing jumped out at me in /var/log
.
推荐答案
我是错的;它发生在其他地方,但我注意到,这是只有.css和.js文件。一个搜索导致我这个帖子其中谈到一个问题vboxsf和小文件。
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
这篇关于共享文件夹在VirtualBox中的Apache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!