httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J.Lance Wilkinson" <>
Subject [users@httpd] SetEnvIf failure or success?
Date Thu, 22 Mar 2012 14:18:10 GMT
I'm trying to extract part of a URI into an environment variable to use in an 
authorization scheme (let's skip talking about how I'll USED that variable for 
the moment).

I have the following directives in my configuration:

LogFormat "%h %l %u %t \"%r\" %>s %b UMG=%{UMG}e" umgs
CustomLog logs/umg.log umgs
     <Location ~ "^/(.*)/umg/.(.*)(.html|/(.*)?)$">
     SetEnvIf REQUEST_URI "^/(.*)/umg/.(.*)(.html|/(.*)?)$" UMG=$2

When I watch that log file, and hit resources that match that location, I'm 
seeing entries in the log which suggest a value for the UMG variable is not 
being extracted: - jlw12 [22/Mar/2012:09:31:13 -0400] "GET
	/umgs/umg.up.dlt.sslcerts.mgttool HTTP/1.1" 301 455 UMG=- - jlw12 [22/Mar/2012:09:31:25 -0400] "GET
	/umgs/umg.up.dlt.ul.gml.managers HTTP/1.1" 301 454 UMG=-

I'd expected to see UMG=up.dlt.sslcerts.mgttool and UMG=up.dlt.ul.gml.managers 
on these two log lines.

Several thoughts come to mind:
1) Logging is taking place before the SetEnvIf takes place.
2) Miscoding of Location's regular expression is causing SetEnvIf to be
3) Miscoding of SetEnvIf's regular expression is causing SetEnvIf to fail.
4) Miscoding of SetEnvIf's value specification is causing failure.

Apache 2.2.6, so I don't have the luxury of setting up debug level logging for 
mod_setenvif; I also don't have immediate access to the source used for 
mod_setenvif so I can't say FOR CERTAIN that it's v2.0.51 or later such that 
the $2 in the value specification is legitimate.

Is there anything obvious in these directives that would bear out one of these 
suspicions, or would point in a different direction?

J.Lance Wilkinson ("Lance")		InterNet:
Systems Design Specialist - Lead	Phone: (814) 865-4870
Digital Library Technologies		FAX:   (814) 863-3560
E3 Paterno Library
Penn State University
University Park, PA 16802

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message