I'm not looking to create custom error pages, but to actually issue error messages when the config file is parsed. Specifically, I want to use an <IfModule> to throw up an error if the module hasn't been loaded, so it's easier to debug.
2 Answers
This is the only kludgy thing I could think of (and requires mod_rewrite enabled):
<IfModule !mod_deflate.c>
ErrorDocument 500 "mod_deflate isn't available"
RewriteEngine On
RewriteRule .* - [R=500]
</IfModule>
If you find a better way to 'trigger' errors, I'm certainly interested ;)
1 Comment
brianmearns
Clever idea. Definitely not what I was looking for, but it would pretty much work. Still looking for better solutions if anyone else has them.
For Httpd 2.4 see http://httpd.apache.org/docs/2.4/en/mod/core.html#error
For older versions
<IfModule !mod_deflate.c>
Mod_deflate_not_enabled.
</IfModule>
will raise something like
Syntax error on line 7 of /etc/apache2/sites-enabled/000-default:
Invalid command 'Mod_deflate_not_enabled.', perhaps misspelled ...
...fail!
when you reload the server config.