定影403禁止在别名目录与Apache [英] Fixing 403 Forbidden on alias directory with Apache
问题描述
我想建立一个别名指向一些目录中我的文件系统没有DocumentRoot的。现在,我得到一个403禁止响应。这些都是采取的步骤:
1.编辑http.conf中,加入:
别名/例如/用户/用户/文件/例子
然后...
<目录/用户/用户/文件/例如>
选择指数多视图了FollowSymLinks
设置AllowOverride无
为了允许,拒绝
所有与LT允许; /目录>
2。设置用chmod权限终端:
行chmod 755 /用户/用户/文件/例子
现在它应该工作?而是我得到禁止访问。这是error_log中的输出:
【孙7月24日6时57分57秒2011] [错误] [客户XX.XX.XX.XX](13)权限被拒绝:访问/例子否认
我是有在OS X这个问题了。原来 gliptak 是正确的,但我有一些细节要补充。
我们俩都在尝试配置一个虚拟目录下,用户的主文件夹的文件夹;我想这就是为什么我们遇到的问题。就我而言,我有以下设置:
- Home文件夹是
/用户/ calrion
。 - 虚拟目录文件夹是
/用户/ calrion /路径/到/ WWW
。 - 有一个符号链接
/用户/ calrion /路径
指向/卷/其它/用户/ calrion /路径
问题是用户和组 _www
(其中运行Apache作为OS X)缺乏执行权限 /用户/ calrion
和 /卷/其它/用户/ calrion
。
运行搭配chmod O + X /用户/ calrion
和搭配chmod O + X /卷/其它/用户/ calrion
解决了这个问题(在OS X 10.7.4)。
这里的规则是: Apache的要求执行访问的所有的路径,以便为文件的文件夹即可。没有这一点,你会得到一个HTTP 403(禁止)。
I am trying to setup an alias to point to some directory on my filesystem not in DocumentRoot. Now I get a 403 Forbidden response. These are the steps taken: 1. edit http.conf, adding:
Alias /example "/Users/user/Documents/example"
then...
<Directory "/Users/user/Documents/example">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all</Directory>
2. setting permissions with chmod in terminal:
chmod 755 /Users/user/Documents/example
Now it should work? instead I get the access forbidden. This is the output from error_log:
[Sun Jul 24 06:57:57 2011] [error] [client xx.xx.xx.xx] (13)Permission denied: access to /example denied
I was having this issue on OS X too. It turned out gliptak was right, but I've some more detail to add.
We're both attempting to configure a virtual directory for a folder under a user's home folder; I think this is why we're having the problem. In my case, I had the following setup:
- Home folder is
/Users/calrion
. - Virtual directory folder is
/Users/calrion/Path/to/www
. - There's a symlink
/Users/calrion/Path
pointing to/Volumes/Other/Users/calrion/Path
.
The problem was the user and group _www
(which Apache runs as on OS X) lacked execute access to /Users/calrion
and /Volumes/Other/Users/calrion
.
Running chmod o+x /Users/calrion
and chmod o+x /Volumes/Other/Users/calrion
resolved the issue (on OS X 10.7.4).
The rule here is that Apache requires execute access to all folders in the path in order to serve files. Without this, you'll get a HTTP 403 (forbidden).
这篇关于定影403禁止在别名目录与Apache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!