Apache配置错误需要全部

时间:2013-12-16 00:47:58

标签: apache configuration config

从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'

显然,错误有点误导,因为一切都是正确的。这条指令有什么问题?

1 个答案:

答案 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>