You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Andrea Gozzi <AG...@dsk.lu> on 2019/11/08 14:07:02 UTC

[users@httpd] Conditional LoadModule

Hi all,

I am attempting to conditionally load a module based on a previously set variable (which is, incidentally, contained in another file and included at the beginning of httpd.conf):

* spec_includes.conf
Define ENABLELDAP 0

* httpd.conf
                Include conf/spec_includes.conf
                [..]
                <If "${ENABLELDAP} == 1">
                                LoadModule authnz_sspi_module modules/mod_authnz_sspi.so
</If>

However this does not seem to be working, the module always ends up being loaded.
The value is correctly initialized (httpd.exe -S) :

[..]
Define: ENABLELDAP=0
[..]

Is such a configuration even possible?

Thank you.

Andrea

Re: [users@httpd] Conditional LoadModule

Posted by Eric Covener <co...@gmail.com>.
On Fri, Nov 8, 2019 at 9:07 AM Andrea Gozzi <AG...@dsk.lu> wrote:
>
> Hi all,
>
>
>
> I am attempting to conditionally load a module based on a previously set variable (which is, incidentally, contained in another file and included at the beginning of httpd.conf):
>
>
>
> * spec_includes.conf
>
> Define ENABLELDAP 0
>
>
>
> * httpd.conf
>
>                 Include conf/spec_includes.conf
>
>                 [..]
>
>                 <If "${ENABLELDAP} == 1">

Use <ifDefine> and Undefine instead of <if> and Define ... 0.

<if> is evaluated during request processing, and special directives
like LoadModule are executed as soon as they are parsed.
(and <ifDefine> doesn't treat a value of 0 differently)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org