0
#<IfModule mod_headers.c>
    Header unset Pragma
    FileETag None
    Header unset ETag
    ExpiresActive On
    <FilesMatch "\\.(ico|jpg..)$">
        etc
    </FilesMatch>
#</IfModule>

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

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.

1

2 Answers 2

2

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.

2

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...
</IfModule>

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .