Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
#<IfModule mod_headers.c>
    Header unset Pragma
    FileETag None
    Header unset ETag
    ExpiresActive On
    <FilesMatch "\\.(ico|jpg..)$">

#<ifmodule mod_php4.c>
    php_value zlib.output_compression 16386

Fellow Folks, Am I allowed to comment those IfModule stuff, as I am not planning to change for the coming whatever years and I am in no terms willing to change Apache for IIS or anything else in the universe.

In other words: whats the actual use of those ifModule stuff? Your enlightening suggestions or answers are much appreciated on this topic.

share|improve this question

migrated from Apr 4 '11 at 14:05

This question came from our site for professional and enthusiast programmers.

Did you RTFM? - – symcbean Apr 4 '11 at 14:43

Those are conditional loads. If a specific Apache module is loaded, then allow that configuration block to take effect. If the modules are not loaded, they're not executed.

share|improve this answer

Note that the leading '#' on a line in an Apache config file indicates a comment. The actual syntax to execute statements only if a given module is already loaded is simply:

<IfModule ...>
    statements to execute...

If you copy blocks of statements with the start and end conditional statements commented out, then the lines within those comments will always be executed. In this case, you will see no error if the module is in fact loaded (or if the statements do not depend on the module). But the purpose of using conditional statements is to avoid errors in the other case.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.