On Mar 23, 2006, at 9:59 AM, Plüm, Rüdiger, VIS wrote:



-----Ursprüngliche Nachricht-----
Von: Jim Jagielski

I want to be able to use same balancer in multiple vhosts.


This is actually that way by design, iirc. I've no
real issues with it being Vhost specific or inheritable.
So if others think it's worthwhile having the above
functionality, I'm +1 for it and would work on something
to implement that.

+1 makes sense.


Something like this maybe? Of course, since it's inherited,
the balancer shows up twice in the balancer-manager, but
maybe that make sense :)

Index: modules/proxy/mod_proxy.c
===================================================================
--- modules/proxy/mod_proxy.c   (revision 389138)
+++ modules/proxy/mod_proxy.c   (working copy)
@@ -1625,6 +1625,19 @@
     conf = ap_set_config_vectors(cmd->server, new_dir_conf, cmd->path,
                                  &proxy_module, cmd->pool);
+    if (strncasecmp(cmd->path, "balancer:", 9) == 0) {
+           proxy_server_conf *sconf =
+ (proxy_server_conf *) ap_get_module_config(cmd->server- >module_config, &proxy_module); + proxy_balancer *balancer = ap_proxy_get_balancer(cmd->pool, sconf, cmd->path);
+        if (!balancer) {
+            const char *err = ap_proxy_add_balancer(&balancer,
+                                                    cmd->pool,
+                                                    sconf, cmd->path);
+            if (err)
+ return apr_pstrcat(cmd->temp_pool, "<Proxy> ", err, NULL);
+        }
+    }
+
errmsg = ap_walk_config(cmd->directive->first_child, cmd, new_dir_conf);
     if (errmsg != NULL)
         return errmsg;

Reply via email to