httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Hosey <>
Subject Re: ap_add_common_vars() clobbers existing values?
Date Sat, 04 Nov 2000 01:43:46 GMT
On Fri, 3 Nov 2000, Tony Finch wrote:
: Adrian Hosey <> wrote:
: >
: >I was originally trying to use SetEnv to override the usual value of the
: >SERVER_NAME (and HTTP_HOST) variables. We have multiple backend servers
: >muxed by a frontend proxy, so I want CGIs running on the backend machines
: >to all see the same hostname in their environment, right?
: Why doesn't UseCanonicalName do the right thing? Or alternatively why
: not set ServerName to the right value in the first place? It doesn't
: have to be the same as the machine's hostname or dns name.

Those are good questions. It's a complicated setup - for a while we were
using ServerName to the desired effect, but now we need each backend
server to have a distinct ServerName in order to do some things with
mod_auth_radius. So I added ProxyPassReverse to prevent URL munging but
that doesn't help the ENV variables for CGIs running on the backend
machines. Any manipulation of those particular ENV variables (SERVER_NAME
and HTTP_HOST) done with SetEnv or mod_rewrite gets clobbered by the cgi
handler's call to ap_add_common_vars().

I have a hack to mod_cgi which copies the existing subprocess_env table
and then overlaps the copy _again_ before exec'ing the CGI, effectively
"unclobbering" the clobbered vars. But I'm not happy with this hack
because (1) it's gross (b) I have to wonder if there's a _reason_ the
designer of these ap_* functions gave precedence to the new vars, in which
case my patch could potentially cause breakage.


(Thanks for taking the time to discuss this.)

"Aw, Mom... You know I'm not like other guys. I'm nervous and my socks are
 too loose."

View raw message