Unrecognized LogFormat directive %

I installed mod_evasive but after that apache refuses to load. I get this:

Oct 31 06:46:55 myserver.mydomain.com httpd[6440]: AH00526: Syntax error on line 11 of /etc/httpd/conf.d/fires.conf:
Oct 31 06:46:55 myserver.mydomain.com httpd[6440]: Unrecognized LogFormat directive %

/etc/httpd/conf.d/servername has the lollowing line:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{userID}n % {userStatus}n" pma_combined

I seem to get worse at this instead of better. Can anyone see the problem?

I’m sure this looks wrong:

%>s

Shouldn’t that be %s? Either that or:

%{userID}n % {userStatus}n

the space between percent sign and userstatus. That’s the only two things that jump out of me, you may wish to check and verify all of that against the Apache documentation for the LogFormat directive.

EDIT:

According to this: mod_log_config - Apache HTTP Server Version 2.4

the %>s is OK, so could be the second option with the space between % and userstatus.

Thanks, you hit it. it was the space % {userStatus}n. Once I removed the space, it all worked fine.

Thanks again

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.