Why is allow not allowed here in apache2

24,673

Because you've got a comma before Limit. That makes apache parse it as though it were part of Options rather than a separate override. Think of it like this:

AllowOverride 
               AuthConfig
               FileInfo 
               Options=Indexes,Limit

What you want is instead

AllowOverride AuthConfig FileInfo Limit Options=Indexes

There's more information at the Apache core documentation.

Share:
24,673

Related videos on Youtube

hjpotter92
Author by

hjpotter92

teh twitters be horrific!!! #SOreadytohelp

Updated on September 18, 2022

Comments

  • hjpotter92
    hjpotter92 over 1 year

    I've the following in my httpd.conf file:

    <Directory "/www">
        Options Indexes FollowSymLinks
        AllowOverride AuthConfig FileInfo Options=Indexes,Limit
        Order allow,deny
        Allow from all
    </Directory>
    

    Next, I've a directory ChatLogs located in server root, with a .htaccess file defined as follows:

    Allow from all
    AuthName "Restricted Area"
    AuthType Basic
    AuthUserFile /www/.htpasswd
    AuthGroupFile /dev/null
    Require valid-user
    

    and when I try to access the directory, I get a 500 server error with the following in server logs (10.109.1.92 is my intranet IP):

    [alert] [client 10.109.1.92] /www/ChatLogs/.htaccess: allow not allowed here
    

    I understand that this is because of the following statement in .htaccess file:

    Allow from all
    

    but could someone explain why is the Allow directive not allowed? I want later to restrict access to certain IP address ranges; and would prefer if it can be placed in singular directories instead of setting them in httpd.conf file.

  • hjpotter92
    hjpotter92 over 10 years
    But commas are allowed as per the documentation here
  • hjpotter92
    hjpotter92 over 10 years
    <strike>Isn't the same true for Indexes as well?</strike> Never mind that. I understand now. :) I have had confused this with AllowOverride Directive lists.
  • Jenny D
    Jenny D over 10 years
    I'm glad you got it working! It can be a bit confusing with having a list within a list :-)