At 04:47 PM 12/22/2003, Stas Bekman wrote:

>I'm not sure this is a good idea to run it on the main host. If it was we could just 
>as well run post_config for each vhost as well. 

No, you missed my earlier point.  post_config is a run-once.  host_init is the
run-each you requested.

>The problem is that if that hook is configurable via a directive this directive will 
>be inherited by all vhosts if defined in the main server (via the usual merge rules). 
>And you end up running it for each vhost even if you didn't intend to.

Stop...  hooks aren't configured by directives as you imply.

The directive is processed in some phase, but the hook runs against all.  That's
why we wondered why you couldn't loop it, although I had no objection to simply
invoking this hook.

As a matter of fact, you give me an idea I'll discuss at the end.

As far as inheritance, hosts *should* inherit global settings unless the author
goes to great pain to *document* and then provide such behavior.  Intuitively
folks presume inheritance within httpd.conf from global into each local conf.

>So if adding this hook at all, it should be invoked *only* on vhosts, and never on 
>the main server [...] and then vhost_init is the right choice.

No... the default server is still a server.  But you make an interesting point, that
certain percolation occurs in the post config.  I suppose I would want that to
happen before my handlers dealt with the per-vhost settings, and I would not
want the changes I make to that global server to percolate any longer in the
host_init phase.  So running the post config, then the host init phases makes
sense for that paradigm.

If we invoke this hook for vhosts, it must be invoked on the main host.

What the handlers do should be affected by the per-host directives, and not
the other way around (handlers shouldn't be invoked because of per-host
directives.)

But let's imagine a scenario of dynamic vhosts, al la htaccess.  It would actually
be quite cool in one thread to create such a dynamic host (propagate from some
given vhost for example.)  This host init hook would still be run against the thread
specific dynamic server record.  We could get away with some really cool things
that way :)  Discuss ...

Bill 

Reply via email to