禁用目录在Apache上市;但进入各个文件应该被允许 [英] Disable directory listing on apache; but access to individual files should be allowed

查看:160
本文介绍了禁用目录在Apache上市;但进入各个文件应该被允许的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不希望使用的.htaccess。我应该如何改变我的目录属性?

 <虚拟主机*:80>
   服务器名abc.com
   的DocumentRoot的/ usr /共享/上传
   <目录的/ usr /共享/上传>
      为了允许,拒绝
      所有允许
   < /目录>
< /虚拟主机>


解决方案

我真的无法找到互联网上的一个直接的答案;即使是在Apache文档。最后,可以找到通过几次迭代解决方案;我们需要使用的选项和值不应该包含索引。

 <目录的/ usr /共享/上传>
        选项​​包括多视图了FollowSymLinks
        设置AllowOverride无
         为了允许,拒绝
      所有允许
   < /目录>

I do not want to use .htaccess. How should I change my Directory attributes?

<VirtualHost *:80>
   ServerName abc.com
   DocumentRoot /usr/share/uploads
   <Directory " /usr/share/uploads">
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>

解决方案

I really couldnt find a direct answer on internet ; even on apache documentation. Finally, could find the solution through few iterations; we need to use Options and the value should NOT contain Indexes.

<Directory "/usr/share/uploads">
        Options Includes FollowSymLinks MultiViews
        AllowOverride None
         Order allow,deny
      Allow from all
   </Directory>

这篇关于禁用目录在Apache上市;但进入各个文件应该被允许的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆