简体   繁体   English

mhddfs(或unionfs)+ Apache =权限被拒绝

[英]mhddfs (or unionfs) + Apache = Permission denied

currently I am trying to set up a virtual machine for development for a client. 目前,我正在尝试为客户开发虚拟机。 Three SVN repositories with PHP code have to be combined in one folder (I know it's ugly, but that's how they roll). 必须将三个包含PHP代码的SVN存储库合并到一个文件夹中(我知道它很丑,但这就是它们的滚动方式)。 I Googled a little and found mhddfs . 我用Google搜索了一下,找到了mhddfs So I checked out the three repositories in a folder called branches : 因此,我在名为branches的文件夹中检出了三个存储库:

branches/branch1
branches/branch2
branches/branch3

I mounted the three branches with mhddfs at /mnt/dev . 我在/mnt/devmhddfs挂载了三个分支。 At the filesystem level, everything works as expected, so ls correctly displays the contents of all three folders (they are disjoint). 在文件系统级别,一切都按预期工作,因此ls正确显示所有三个文件夹的内容(它们是不相交的)。 However, trying to fire up the document root with Apache results in a 403 Forbidden error. 但是,尝试使用Apache启动文档根目录会导致403 Forbidden错误。 I tried other locations than /mnt/dev as well, leading to no difference. 我尝试了/mnt/dev以外的其他位置,导致没有区别。

[Mon Feb 06 17:44:41 2012] [error] [client 192.168.56.1]
(13)Permission denied: access to / denied

When I do not mount the three folders but just put an index.php file into /mnt/dev , everything works as expected. 当我不挂载这三个文件夹而只是将index.php文件放入/mnt/dev ,一切都会按预期进行。 Am I missing something? 我想念什么吗?

Thanks for your help in advance. 感谢您的帮助。

EDIT: Some more data on the problem: When I create two directories, that are world-accessible ... 编辑:关于此问题的一些其他数据:当我创建两个目录时,可以在世界范围内访问...

root@devbox:/tmp > ls -lha
drwxrwxrwt  6 root     root   4,0K  6. Feb 20:11 .
drwxr-xr-x 21 root     root   4,0K  6. Feb 10:07 ..
drwxrwxrwx  2 www-data vboxsf 4,0K  6. Feb 20:11 test1 # includes index.htm
drwxrwxrwx  2 www-data vboxsf 4,0K  6. Feb 20:13 test2 # includes index2.htm

... and mount them via mhddfs ... ...并通过mhddfs安装它们...

mhddfs /tmp/test1,/tmp/test2 /mnt/dev
mhddfs: directory '/tmp/test1' added to list
mhddfs: directory '/tmp/test2' added to list
mhddfs: mount to: /mnt/dev
mhddfs: move size limit 4294967296 bytes

... ls behaves correctly ... ls行为正确...

root@devbox:/tmp > ls -lh /mnt/dev/
insgesamt 8,0K
-rwxrwxrwx 1 www-data vboxsf 12  6. Feb 20:11 index2.htm
-rwxrwxrwx 1 www-data vboxsf 11  6. Feb 20:11 index.htm

... while Apache (user: www-data , group: vboxsf ) doesn't and terminates with the 403 error stated above. ...而Apache(用户: www-data ,组: vboxsf )没有,并且以上述403错误终止。 However, if I unmount the folders and just put an index.htm in /mnt/dev , everything works as expected as Apache can read the file. 但是,如果我卸载文件夹,然后将index.htm放在/mnt/dev ,则一切正常,因为Apache可以读取文件。

Any ideas? 有任何想法吗?

All the best, Martin 祝一切顺利,马丁

I encountered the same problem on Linux. 我在Linux上遇到了同样的问题。
Following the steps below, I was able to solve it. 按照以下步骤,我能够解决它。

[STEPS]

  1. Enable 'user_allow_other' in /etc/fuse.conf 在/etc/fuse.conf中启用'user_allow_other'
  2. Use mhddfs with '-o allow_other' option 将mhddfs与'-o allow_other'选项一起使用
    ex. 例如 mhddfs -o allow_other /dir1,/dir2 /path/to/mount mhddfs -o allow_other / dir1,/ dir2 / path / to / mount

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM