Question

I want to have a config block (in an included file) that will LoadModule different files depending on apache version.

e.g.

<some kind of magic detecting apache 2.2>
LoadModule  my_module /usr/local/my/module22.so

<else if apache 2.4>
LoadModule  my_module /usr/local/my/module24.so
<end magic>

Is there an easy way to do this?

The longer version of my question: I have an apache module that I build both 22 and 24 versions of. On production servers, both modules are installed. I do not have control over which version of apache is run nor over the startup options (thus eliminating directives).

I have a small config stub file that gets included by the main config file that has, approximately:

LoadModule my_module /usr/local/my/module22.so

<IfModule my_module>
..... some config stuff that is valid for either version
</IfModule>

The module itself is source-code compatible with both versions of apache, but i have to have different binaries since the module api is not binary compatible.

Most servers use 2.2, and a few use 2.4, all out side my control. I'd like the right thing to happen automatically, but I have not found a way yet. Whatever I do, it needs to be syntax-compatible with both 2.2 and 2.4. Ideas?

Or, is there some other way to

Was it helpful?

Solution

This is available in apache directives: IfVersion

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top