我使用的是Apache 2.2而不是2.4,它解释了标题中的错误。 Brain99发表了他的评论后,我发现我有2.2,调整了我的configuration,以他的build议(仍然没有工作),尝试了一下,睡了一晚,第二天我发现,我忘了包含用于启用mod的目录的语句!
现在我只需要服务器让我从一个特定的文件夹下载文件(在我的情况下,我select了/ opt / myFolder)
分布是Debian 6.0
edit_start
Apache版本是2.4,根据他们的官方文档,订单/允许条款已被弃用,不应该再使用
我是一个白痴:Apache版本是2.2。
edit_end 我在apache2.conf中的目录指令如下所示:
<IfModule dir_module> DirectoryIndex index.html index.htm index.php </IfModule> ServerRoot "/etc/apache2" DocumentRoot "/opt/myFolder" <Directory /> Options FollowSymLinks AuthType None AllowOverride None Require all denie </Directory> <Directory "/opt/myFolder/*"> Options FollowSymLinks MultiViews AllowOverride None AuthType None Require all allow </Directory>
当我尝试访问该文件夹( http://myserver.de/aTestFile.zip )中的文件时,出现内部服务器错误。 另外,Apache将以下错误写入日志中:
configuration error: couldn't check user. Check your authn provider!: /aTestFile.zip
为什么我需要一个authn提供程序,如果我不想要任何身份validation? 另外我希望有人能向我解释我需要什么样的AuthenticationProvider。 每当我search这些东西时,我都会指出人们要求如何用密码保护文件/目录或限制对某些IP地址的访问,这对我没有任何帮助。
好吧,因为我的Apache 2.2版本,这是我使用Order / Deny / Allow命令而不是AuthType / Require时得到的错误:
Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration.
我相信这是由于以下错误的configuration指令:
Require all denie Require all allow
请尝试以下configuration:
<Directory /> Options FollowSymLinks AuthType None AllowOverride None Order deny,allow Deny from all </Directory> <Directory "/opt/myFolder/*"> Options FollowSymLinks MultiViews AllowOverride None AuthType None Order deny,allow Allow from all </Directory>
编辑2 :你的问题也可能是由于mod_authz_host模块没有被加载。 您可以尝试使用a2enmod authz_host启动并重新启动apache。
另外,似乎AuthType None无效。 只需从您的configuration中完全删除AuthType指令。