How do I load mod_version only if it isn't built in to apache?

5,184

You can conditionally load it if it isn't already:

<IfModule !version_module>
LoadModule version_module /usr/lib/apache2/modules/mod_version.so
</IfModule>
Share:
5,184

Related videos on Youtube

Marcel Macasso
Author by

Marcel Macasso

SOreadytohelp

Updated on September 18, 2022

Comments

  • Marcel Macasso
    Marcel Macasso almost 2 years

    Apache 2.4 seems to have mod_version built in. Trying to load it with:

    LoadModule version_module /usr/lib/apache2/modules/mod_version.so
    

    gets an error:

    Syntax error on line 26 of /home/ysth/src/conf/apache2.conf: module version_module is built-in and can't be loaded
    

    (and the mod_version.so file doesn't exist anyway).

    I have a number of standalone apache configuration files used to run various services, so the normal mods_enabled directory isn't suitable. I want to use IfVersion to have the same conf file used for both apache2.2 and apache2.4. How can I load mod_version only for apache2.2?