httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <>
Subject Re: Question about LoadModule inside <VirtualHost> container
Date Fri, 19 Mar 2010 16:58:43 GMT
On Thu, Mar 18, 2010 at 2:45 PM, Yonts, Richard
<> wrote:
> An Apache server was misconfigured where a LoadModule directive was inside a
> <VirtualHost *:444> definition.  I have found  a smattering of documentation
> saying that the LoadModule must be in the server context, not a container
> context.  Assuming is correct, I have a question about what I did observe.
> My module created a server configuration and initialized it, one flag of
> which was that the initialization was complete.  When a Location directive
> was hit, the initialized data gets displayed.  Here is the oddity: When I
> hit the Location from anything other than port 444, I would see the
> initialized data; however, when I hit the Location using port 444, the data
> was uninitialized.  Why?
> I would expect that the port 444 config block would be the initialized one
> and every other one would be uninitialized, but I observed the exact
> opposite.  I think that in this case there would be two server config
> blocks, one for 444 and one in general.  Of course, I can find no
> documentation to explain this, and possibly it needs no explanation, but
> does anyone have a reasonable idea as to what is going on?
> I moved the LoadModule outside the virtual container and all works as
> expected; I simply remain puzzled why it broke “backwards”.

My guess is that your module's server_config creation and merging was
broken because the LoadModule-driven call to create the server_config
structure used the vhost-specific server_rec instead of the global
server_rec.  At a later point the vhost-specific config would be
created again if your module had directives in that vhost, or be

LoadFile and LoadModule should both ensure that they're coded at
global scope, or report a configuration error.  That logic was added
to the 1.3 branch but lost in 2.0 and later.

I'll fix trunk.

View raw message