【问题标题】:Apache serving files that should not be served不应提供的 Apache 服务文件
【发布时间】:2008-09-03 06:11:09
【问题描述】:

今天我发现我全新安装的 Apache HTTP Server 能够提供来自我的C:\uploads\ 目录的文件。

我在C:\uploads 中有两个文件夹:

  • C:\uploads\templates
  • C:\uploads\sites

两个文件夹都包含testimage.jpg

我发现如果我请求 Apache 将提供模板文件夹中的文件:

http://localhost/templates/testimage.jpg

但是,http://localhost/sites/testimage.jpg 404 的!

OMG - 首先,为什么 Apache 首先提供 templates 文件夹?有什么特别的吗?

其次,apache 通过什么任意规则集禁止访问其他文件夹,例如站点?

我很困惑。也许我在安装过程中的某个地方走错了方向。

【问题讨论】:

    标签: apache webserver hosting web-hosting self-hosting


    【解决方案1】:

    您是否查看了您的 httpd.conf 文件以查看针对所提供内容的规则?或者,是否有 .htaccess 文件可能会改变所服务的内容?您可能在其中一个或另一个中公开了模板,但没有在站点中公开...这是首先想到的。

    我建议用细齿梳仔细检查这些配置文件,看看是什么导致了你看到的行为。

    【讨论】:

      猜你喜欢
      • 2019-08-24
      • 2021-04-13
      • 1970-01-01
      • 2012-01-18
      • 2015-02-12
      • 2019-10-03
      • 2017-04-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多