0

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 2

1

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 ;)

Sign up to request clarification or add additional context in comments.

1 Comment

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.
1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.