apache配置报错:Unrecognized LogFormat directive %I

时间:2023-03-09 09:22:58
apache配置报错:Unrecognized LogFormat directive %I

跟着阿里云调日志教程(https://help.aliyun.com/document_detail/87740.html)时出现报错:

AH00526: Syntax error on line ... of httpd.conf:Unrecognized LogFormat directive %I

其实在配置文件中就有答案:

<IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

</IfModule>

我们只需要找到:

LoadModule logio_module modules/mod_logio.so

并将注释去除即可