httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@engelschall.com (Ralf S. Engelschall)
Subject Re: Interesting problem: virtual host config
Date Fri, 27 Feb 1998 13:17:41 GMT

In article <199802271118.MAA24881@en1.engelschall.com> you wrote:

> In article <Pine.LNX.3.96dg4.980226122917.3040H-100000@twinlark.arctic.org> you
wrote:

>[...]
> Hmmm... while your conf->server != r->server trick is the key to our solution
> I still searching now for a general solution without having to change all
> places where get_module_config() is called.

I've poked around in httpd_config and found the reason why modules don't
become a chance to initialise their sever config for virtual host sections.
Because while for the main server create_server_config() is used, the virtual
servers just use create_empty_config() and then later fill in particular
configs just for existing directives. 

I'm not sure if the following change is really a good one, but it would solve
the problem, I think and would avoid confusion in the future. On the other
hand it forces a little bit too much config-initialisation on startup.  But
its on startup so we could accept this. Is this again totally wrong or perhaps
a possibility?

Index: http_config.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/main/http_config.c,v
retrieving revision 1.99
diff -u -r1.99 http_config.c
--- http_config.c       1998/02/25 09:36:12     1.99
+++ http_config.c       1998/02/27 13:11:32
@@ -1177,11 +1177,11 @@
     s->is_virtual = 1;
     s->names = NULL;
 
-    s->module_config = create_empty_config(p);
-    s->lookup_defaults = create_per_dir_config(p);
-
     s->server_uid = user_id;
     s->server_gid = group_id;
+
+    s->module_config = create_server_config(p, s);
+    s->lookup_defaults = create_per_dir_config(p);
 
     *ps = s;

Greetings,
                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Mime
View raw message