【问题标题】:Deny access permissions - apache, linux拒绝访问权限 - apache、linux
【发布时间】:2013-08-23 17:45:47
【问题描述】:

如何拒绝对除一个文件之外的整个文件夹的访问权限? 例如,我的DocumentRoot"/var/www/html",我有一个名为example 的文件夹。那里有很多文件,其中一个是index.php。所以我想只授予这个文件的访问权限,而拒绝该文件夹中其他文件的访问权限。

【问题讨论】:

    标签: linux apache permissions


    【解决方案1】:

    您是否在您的 apache 配置(服务器 httpd.conf.htaccess 文件)中尝试过类似的操作?

    <Directory "/var/www/html/example">
       <FilesMatch index.php*> 
          Order allow,deny 
          Allow from all 
       </FilesMatch> 
       Order deny,allow 
       Deny from all 
    </Directory>
    

    【讨论】:

    • 是的,这个方向解决问题。我也不得不使用这个(在.htaccess):例如&lt;Files index.php&gt; require valid-user &lt;/Files&gt;
    猜你喜欢
    • 2014-03-16
    • 1970-01-01
    • 1970-01-01
    • 2012-08-13
    • 1970-01-01
    • 2014-06-29
    • 2014-08-10
    相关资源
    最近更新 更多