httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1477649 - in /httpd/httpd/branches/2.4.x: ./ CHANGES docs/manual/ docs/manual/howto/ docs/manual/mod/ docs/manual/mod/mod_proxy.xml docs/manual/rewrite/ include/ap_mmn.h modules/proxy/mod_proxy.c modules/proxy/mod_proxy.h
Date Tue, 30 Apr 2013 14:18:14 GMT
Author: jim
Date: Tue Apr 30 14:18:13 2013
New Revision: 1477649

URL: http://svn.apache.org/r1477649
Log:
Merge r1387603, r1388029, r1420124, r1421288, r1421912, r1422943, r1422980, r1430575, r1439404
from trunk:

wtf are we doing merging in these from the parent??
These are server specific!


OK, enable/allow previous broken, bad behavior iff the user
really, really wants it. And warn that b-m isn't recommended
in those cases.

rjung's suggestions...

inherit inherit


Use inherit_set to let the global server set
the default for all vhosts.

Otherwise inherit would need to be disabled
redundantly in each vhost.


restrict inherit control to those fields that "require" it...

Redfine - we are just worried about balancers and workers, so have the directive clear about
that.

Naming


ProxyPassInherit directive
Submitted by: jim, rjung, jim, jim, jim, jim
Reviewed/backported by: jim

Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/docs/manual/   (props changed)
    httpd/httpd/branches/2.4.x/docs/manual/howto/   (props changed)
    httpd/httpd/branches/2.4.x/docs/manual/mod/   (props changed)
    httpd/httpd/branches/2.4.x/docs/manual/mod/mod_proxy.xml
    httpd/httpd/branches/2.4.x/docs/manual/rewrite/   (props changed)
    httpd/httpd/branches/2.4.x/include/ap_mmn.h
    httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy.c
    httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy.h

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1387603,1388029,1420124,1421288,1421912,1422943,1422980,1430575,1439404

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1477649&r1=1477648&r2=1477649&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Tue Apr 30 14:18:13 2013
@@ -2,6 +2,10 @@
 
 Changes with Apache 2.4.5
 
+  *) mod_proxy: Add BalancerInherit and ProxyPassInherit to control
+     whether Proxy Balancers and Workers are inherited by vhosts
+     (default is On). [Jim Jagielski]
+
   *) mod_authnz_ldap: Allow using exec: calls to obtain LDAP bind
      password.  [Daniel Ruggeri]
 

Propchange: httpd/httpd/branches/2.4.x/docs/manual/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk/docs/manual:r1387603,1388029,1420124,1421288,1421912,1422943,1422980,1430575,1439404

Propchange: httpd/httpd/branches/2.4.x/docs/manual/howto/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk/docs/manual/howto:r1387603,1388029,1420124,1421288,1421912,1422943,1422980,1430575,1439404

Propchange: httpd/httpd/branches/2.4.x/docs/manual/mod/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk/docs/manual/mod:r1387603,1388029,1420124,1421288,1421912,1422943,1422980,1430575,1439404

Modified: httpd/httpd/branches/2.4.x/docs/manual/mod/mod_proxy.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/mod/mod_proxy.xml?rev=1477649&r1=1477648&r2=1477649&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/mod/mod_proxy.xml (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/mod/mod_proxy.xml Tue Apr 30 14:18:13 2013
@@ -663,7 +663,43 @@ expressions</description>
         normal restart/graceful state transitions.</p>
     </usage>
 </directivesynopsis>
-    
+
+<directivesynopsis>
+    <name>ProxyPassInherit</name>
+    <description>Inherit ProxyPass directives defined from the main server</description>
+    <syntax>ProxyPassInherit On|Off</syntax>
+    <default>ProxyPassInherit On</default>
+    <contextlist><context>server config</context><context>virtual
host</context></contextlist>
+    <compatibility>ProxyPassInherit is only available in Apache HTTP Server 2.5.0 and
later.
+        and later.</compatibility>
+    <usage>
+        <p>This directive will cause the current server/vhost to "inherit"
+            <directive module="mod_proxy">ProxyPass</directive>
+            directives defined in the main server. This can cause issues and
+            inconsistent behavior if using the Balancer Manager for dynamic changes
+            and so should be disabled if using that feature.</p>
+        <p>The setting in the global server defines the default for all vhosts.</p>
+        <p>Disabling ProxyPassInherit also disables <directive module="mod_proxy">BalancerInherit</directive>.</p>
+    </usage>
+</directivesynopsis>
+
+<directivesynopsis>
+    <name>BalancerInherit</name>
+    <description>Inherit ProxyPassed Balancers/Workers from the main server</description>
+    <syntax>BalancerInherit On|Off</syntax>
+    <default>BalancerInherit On</default>
+    <contextlist><context>server config</context><context>virtual
host</context></contextlist>
+    <compatibility>BalancerInherit is only available in Apache HTTP Server 2.5.0
+        and later.</compatibility>
+    <usage>
+        <p>This directive will cause the current server/vhost to "inherit" ProxyPass
+            Balancers and Workers defined in the main server. This can cause issues and
+            inconsistent behavior if using the Balancer Manager and so should be disabled
+            if using that feature.</p>
+        <p>The setting in the global server defines the default for all vhosts.</p>
+    </usage>
+</directivesynopsis>
+
 <directivesynopsis>
     <name>BalancerMember</name>
     <description>Add a member to a load balancing group</description>

Propchange: httpd/httpd/branches/2.4.x/docs/manual/rewrite/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk/docs/manual/rewrite:r1387603,1388029,1420124,1421288,1421912,1422943,1422980,1430575,1439404

Modified: httpd/httpd/branches/2.4.x/include/ap_mmn.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/include/ap_mmn.h?rev=1477649&r1=1477648&r2=1477649&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/include/ap_mmn.h (original)
+++ httpd/httpd/branches/2.4.x/include/ap_mmn.h Tue Apr 30 14:18:13 2013
@@ -403,6 +403,7 @@
  * 20120211.11 (2.4.4-dev) Add ap_bin2hex()
  * 20120211.12 (2.4.5-dev)  Add ap_remove_input|output_filter_byhandle()
  * 20120211.13 (2.4.5-dev)  Add ap_get_exec_line
+ * 20120211.14 (2.4.5-dev)  Add ppinherit and inherit to proxy_server_conf
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
@@ -410,7 +411,7 @@
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
 #define MODULE_MAGIC_NUMBER_MAJOR 20120211
 #endif
-#define MODULE_MAGIC_NUMBER_MINOR 13                   /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 14                   /* 0...n */
 
 /**
  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a

Modified: httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy.c?rev=1477649&r1=1477648&r2=1477649&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy.c (original)
+++ httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy.c Tue Apr 30 14:18:13 2013
@@ -1168,6 +1168,10 @@ static void * create_proxy_config(apr_po
     ps->req = 0;
     ps->max_balancers = 0;
     ps->bal_persist = 0;
+    ps->inherit = 1;
+    ps->inherit_set = 0;
+    ps->ppinherit = 1;
+    ps->ppinherit_set = 0;
     ps->bgrowth = 5;
     ps->bgrowth_set = 0;
     ps->req_set = 0;
@@ -1194,13 +1198,30 @@ static void * merge_proxy_config(apr_poo
     proxy_server_conf *base = (proxy_server_conf *) basev;
     proxy_server_conf *overrides = (proxy_server_conf *) overridesv;
 
-    ps->proxies = apr_array_append(p, base->proxies, overrides->proxies);
+    ps->inherit = (overrides->inherit_set == 0) ? base->inherit : overrides->inherit;
+    ps->inherit_set = overrides->inherit_set || base->inherit_set;
+
+    ps->ppinherit = (overrides->ppinherit_set == 0) ? base->ppinherit : overrides->ppinherit;
+    ps->ppinherit_set = overrides->ppinherit_set || base->ppinherit_set;
+
+    if (ps->ppinherit) {
+        ps->proxies = apr_array_append(p, base->proxies, overrides->proxies);
+    }
+    else {
+        ps->proxies = overrides->proxies;
+    }
     ps->sec_proxy = apr_array_append(p, base->sec_proxy, overrides->sec_proxy);
     ps->aliases = apr_array_append(p, base->aliases, overrides->aliases);
     ps->noproxies = apr_array_append(p, base->noproxies, overrides->noproxies);
     ps->dirconn = apr_array_append(p, base->dirconn, overrides->dirconn);
-    ps->workers = apr_array_append(p, base->workers, overrides->workers);
-    ps->balancers = apr_array_append(p, base->balancers, overrides->balancers);
+    if (ps->inherit || ps->ppinherit) {
+        ps->workers = apr_array_append(p, base->workers, overrides->workers);
+        ps->balancers = apr_array_append(p, base->balancers, overrides->balancers);
+    }
+    else {
+        ps->workers = overrides->workers;
+        ps->balancers = overrides->balancers;
+    }
     ps->forward = overrides->forward ? overrides->forward : base->forward;
     ps->reverse = overrides->reverse ? overrides->reverse : base->reverse;
 
@@ -1898,6 +1919,26 @@ static const char *set_persist(cmd_parms
     return NULL;
 }
 
+static const char *set_inherit(cmd_parms *parms, void *dummy, int flag)
+{
+    proxy_server_conf *psf =
+    ap_get_module_config(parms->server->module_config, &proxy_module);
+
+    psf->inherit = flag;
+    psf->inherit_set = 1;
+    return NULL;
+}
+
+static const char *set_ppinherit(cmd_parms *parms, void *dummy, int flag)
+{
+    proxy_server_conf *psf =
+    ap_get_module_config(parms->server->module_config, &proxy_module);
+
+    psf->ppinherit = flag;
+    psf->ppinherit_set = 1;
+    return NULL;
+}
+
 static const char *add_member(cmd_parms *cmd, void *dummy, const char *arg)
 {
     server_rec *s = cmd->server;
@@ -2287,6 +2328,12 @@ static const command_rec proxy_cmds[] =
      "Number of additional Balancers that can be added post-config"),
     AP_INIT_FLAG("BalancerPersist", set_persist, NULL, RSRC_CONF,
      "on if the balancer should persist changes on reboot/restart made via the Balancer Manager"),
+    AP_INIT_FLAG("BalancerInherit", set_inherit, NULL, RSRC_CONF,
+     "on if this server should inherit Balancers and Workers defined in the main server "
+     "(Not recommended if using the Balancer Manager for dynamic changes)"),
+    AP_INIT_FLAG("ProxyPassInherit", set_ppinherit, NULL, RSRC_CONF,
+     "on if this server should inherit all ProxyPass directives defined in the main server
"
+     "(Not recommended if using the Balancer Manager for dynamic changes)"),
     AP_INIT_TAKE1("ProxyStatus", set_status_opt, NULL, RSRC_CONF,
      "Configure Status: proxy status to one of: on | off | full"),
     AP_INIT_RAW_ARGS("ProxySet", set_proxy_param, NULL, RSRC_CONF|ACCESS_CONF,

Modified: httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy.h?rev=1477649&r1=1477648&r2=1477649&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy.h Tue Apr 30 14:18:13 2013
@@ -179,6 +179,10 @@ typedef struct {
     unsigned int source_address_set:1;
     unsigned int bgrowth_set:1;
     unsigned int bal_persist:1;
+    unsigned int inherit:1;
+    unsigned int inherit_set:1;
+    unsigned int ppinherit:1;
+    unsigned int ppinherit_set:1;
 } proxy_server_conf;
 
 



Mime
View raw message