【问题标题】:XAMPP and .htaccess authentication on Windows 2008 R2 - Missing AccessFileNameWindows 2008 R2 上的 XAMPP 和 .htaccess 身份验证 - 缺少 AccessFileName
【发布时间】:2013-10-01 09:07:53
【问题描述】:

我已在我的 Windows 2008 R2 服务器上成功安装并运行 XAMPP。阿帕奇运行良好。我想使用 Apache 基本身份验证对特定目录进行密码保护。在使用 XAMPP 时,我查看了涵盖 .htaccess 的各种文章,但它们提到了我的 httpd.conf 文件中缺少的指令。

AccessFileName

如果httpd.conf 文件中没有此条目,我应该继续添加它吗?

以下是有关我的设置的其他一些信息:

  1. mod-rewrite 已启用 - LoadModule rewrite_module modules/mod_rewrite.so
  2. IIS 未启用

【问题讨论】:

  • 谢谢@Prix。我不确定为什么我的 httpd.conf 没有AccessFileName。我继续添加它,一切正常。

标签: apache .htaccess xampp


【解决方案1】:

我使用的是 Xampp v3.2.4,但在 httpd.conf 中也没有找到 AccessFileName。 我已经在 conf/extra 目录中搜索了这个文本。 并在 conf/extra/httpd-default.conf

中找到 AccessFileName

此文件httpd-default.conf 包含在httpd.conf 文件中。 在 httpd.conf 中找到Include "conf/extra/httpd-default.conf"

因此您无需手动添加。只需尝试更改那里并确保Include "conf/extra/httpd-default.conf" 未被# 评论。

【讨论】:

    【解决方案2】:

    如果你不尝试添加它,你的httpd.conf 中应该有这样的东西。

    #
    # AccessFileName: The name of the file to look for in each directory
    # for additional configuration directives.  See also the AllowOverride
    # directive.
    #
    AccessFileName .htaccess
    

    你也应该有这个:

    #
    # The following lines prevent .htaccess and .htpasswd files from being
    # viewed by Web clients.
    #
    <Files ~ "^\.ht">
        Order allow,deny
        Deny from all
        Satisfy All
    </Files>
    

    很奇怪,您缺少它,因为它是默认设置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-23
      • 1970-01-01
      • 2011-06-16
      • 2015-06-01
      • 2017-10-18
      • 1970-01-01
      相关资源
      最近更新 更多