从apache 2.2升级到2.4后,我遇到了一个奇怪的apache配置错误。我的vhost配置文件包含以下目录指令:
<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>
哪个符合新的指令语法。但是,当我启动apache时,我收到此消息,指示Require all
指令上的一些错误:
AH00526: Syntax error on line 22 of C:/data/projectx/src/admin/local.conf:
Argument for 'Require all' must be 'granted' or 'denied'
显然,错误有点误导,因为一切都是正确的。这条指令有什么问题?
答案 0 :(得分:8)
解决方案:删除Require all
指令后的注释:
<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>