Directory directive: AuthType None but still need an AuthProvider?
I believe this is due to the following erroneous configuration directives:
Require all denie
Require all allow
Try the following configuration instead:
<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>
Edit 2: Your problem could also be due to the mod_authz_host module not being loaded. You can try enabling this with a2enmod authz_host
and restarting apache.
Also, it seems that AuthType None
is invalid. Just remove the AuthType
directive entirely from your configuration.
Related videos on Youtube
Steffen Winkler
Updated on September 18, 2022Comments
-
Steffen Winkler almost 2 years
I'm using Apache 2.2 instead of 2.4, which explains the error in the title. After Brain99 posted his comment, I found out that I had 2.2, adjusted my configuration to what he suggested (which still didn't work), tried around a bit, slept a night and the next day I found out, that I forgot the Include statements for the mod-enabled directory!
For now I just need the server to let me download files from one specific folder (in my case I chose /opt/myFolder for that task)
Distribution is Debian 6.0
edit_start
Apache version is 2.4, according to their official documentation, the Order/Allow clauses are deprecated and should not be used anymoreI'm an idiot: Apache version is 2.2.
edit_end
My directory directives in apache2.conf look like this:<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>
When I try to access a file inside that folder (http://myserver.de/aTestFile.zip) I get an Internal Server Error. Also Apache writes the following error into it's log:
configuration error: couldn't check user. Check your authn provider!: /aTestFile.zip
Why would I need an authn provider if I don't want any authentication? Also I hope someone can explain to me what kind of AuthenticationProvider I'd need for that. Everytime I search for those things I get pointed at people asking how to protect files/directories with passwords or restrict access to some IP addresses, which doesn't really help me.
ok, since I've Apache version 2.2, here is the error I get when using the Order/Deny/Allow commands instead of AuthType/Require:
Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration.
-
Steffen Winkler almost 12 yearswell, in that case Apache doesn't start at all. Output from apachectl start
Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
. Are you sure that this option is still available in Apache 2.4? I saw a few forum threads where it was said that those options were dropped and replaced by the Require clauses. -
brain99 almost 12 yearsSee my edited answer.
-
Steffen Winkler almost 12 yearsI'm stupid. My apache version is 2.2. But why do I get that error?
-
Steffen Winkler almost 12 yearsalso, even with your edits it doesn't work.
-
Steffen Winkler almost 12 yearsto your 2nd edit: AuthType None is supported, according to official documentation. Anyway, when I remove it, apache says that it
couldn't perform authentication. AuthType is not set.
-
brain99 almost 12 yearsAre we looking at the same docs? According to this, the accepted values are
Basic
andDigest
. The valueNone
is apache 2.3+ only. -
Steffen Winkler almost 12 yearsyes, I looked at the 2.4 docs, sorry.
-
Steffen Winkler almost 12 yearswell, I got it working with the appropiate config for 2.2 (Order/allow combination). I made the following mistakes: I thought I had Apache 2.4, which wasn't the case and I found out about that after your answer I tried your config, which didn't work at first and gave me the
Invalid command
error. After a night of sleep, I looked at the apache config again and saw that stupid me forgot to add the include directives for the module-enabled directory. -
sites almost 11 yearscould you explain how to include these modules? thanks