我在Fedora 13上运行了几个web开发项目,我通常将Apache设置为虚拟主机来为我的大型项目服务,但我有几个小项目循环运行,我不太愿意为每个项目设置一个VirtualHost。相反,我希望它们都位于主VirtualHost条目的子目录下。我只想让Apache在我浏览到主机名时为我提供目录索引。
例如,主机名projects.mydomain.com引用/var/www/projects,并且该目录仅包含子目录(没有索引文件)。
不幸的是,当我直接浏览主机时,我得到:
禁止您没有访问/访问此服务器的权限。此外,在尝试使用ErrorDocument处理请求时遇到了一个404未找到的错误。
但是我在apache配置中的虚拟主机条目如下所示:
<VirtualHost *>
ServerName projects.mydomain.com
DocumentRoot /var/www/projects
<Directory "/var/www/projects">
Options +FollowSymlinks +Indexes
AllowOverride all
</Directory>
</VirtualHost>我在这里错过了什么?
发布于 2013-01-23 18:02:45
检查下面的配置中是否有类似的内容。它匹配"/“并拒绝索引。
<LocationMatch "^/+$">
Options -Indexes
ErrorDocument 403 /error/noindex.html
</LocationMatch>发布于 2011-02-08 22:24:43
尝试添加以下内容:
<Directory />
Options +FollowSymlinks +Indexes
AllowOverride all
</Directory>https://serverfault.com/questions/232949
复制相似问题