Apache: Testing against multiple module

apache-2.2httpd.conf

We can use Apache's IfModule directive to test presence or absence of a specific module. Apache also allows nested IfModule directives which can be used to test multiple modules, in other words we can implement logic AND.

Is it also possible to implement logic OR? For example is it possible to use something similar to this:

<IfModule mod_php5.c OR sapi_apache2.c>
    # Some directives
</IfModule>

Instead of this:

<IfModule mod_php5.c>
    # Some directives
</IfModule>
<IfModule sapi_apache2.c>
    # Absolutely same directives with mod_php.c
</IfModule>

Best Answer

While it's not perfect, you could put the directives you want into a separate file, and then Include it in the relevant locations. I don't believe there's a way to do a logical OR in a single IfModule statement.