Apache启动报错:Invalid command 'AuthType', perhaps misspelled or defined by a module not included in it

在apache配置文件里面加了AuthType PFApacheAgent,,结果重启apache的时候歇菜了,,总是报上面的错,

<Directory />

AllowOverride none

Options None

AuthType PFApacheAgent

Require all granted

</Directory>

网上搜索有说,在Apache2.4版本中,提供了由mod_authz_host支持的新的访问控制配置语法。而2.2版本中的Order、Allow等命令在新版本中也可以得到兼容,实现这个兼容功能的模块就是mod_access_compat。所以Load这个模块后,apache2.4就能识别这些语句了。

但是在httpd.conf 中load mod_access_compat.so 重启还是出错,,

后来,搜了很多终于找到了方法,,

到 /conf.modules.d/00-base.conf 下面将如下这行打开,启动就OK 了。

#LoadModule authn_core_module modules/mod_authn_core.so