Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache config error Require all

After upgrading from apache 2.2 to 2.4 I have a strange apache config error. My vhost config file contains the following directory directive:

<Directory "C:/data/projectx/src/htdocs">  
            Options None 
            AllowOverride None
            #Order allow,deny   # old config style
            #Allow from all     # old config style
            Require all granted # new config style (replaces both rules above)
</Directory>

Which is conform with the new directive syntax. However, when I start apache I get this message, indicating some error on the Require all directive:

AH00526: Syntax error on line 22 of C:/data/projectx/src/admin/local.conf:
Argument for 'Require all' must be 'granted' or 'denied'

Obviously the error is somewhat misleading, as everything is correct. What is wrong with this directive?

like image 325
stot Avatar asked Jan 11 '23 16:01

stot


1 Answers

Solution: remove the comment after the Require all directive:

<Directory "C:/data/projectx/src/htdocs">  
            Options None 
            AllowOverride None
            #Order allow,deny   # old config style
            #Allow from all     # old config style
            # -->> moved comment into own line: new config style ...
            Require all granted 
</Directory>
like image 148
stot Avatar answered Jan 18 '23 20:01

stot