Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
#<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.

share|improve this question

migrated from stackoverflow.com Apr 4 '11 at 14:05

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

    
Did you RTFM? - httpd.apache.org/docs/2.0/mod/core.html#ifmodule –  symcbean Apr 4 '11 at 14:43
add comment

2 Answers

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
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

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.