Search code examples
apacheconfigurationapache-configapache-modules

Apache2 Configuration: Execute if mod is enabled?


Is there a possibility to execute a part of a configuration file in Apache 2.4 only if a specific mod (e.g. mod_wsgi) is enabled?


Solution

  • Apache provides IfModule for this, see the docs.

    Use it like this:

    <IfModule ssl_module>
        Include conf/extra/httpd-ssl.conf
        SSLRandomSeed startup builtin
        SSLRandomSeed connect builtin
    </IfModule>