httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew <and...@aaaaaaaa.demon.co.uk>
Subject Re: mod_env.c
Date Sat, 17 Feb 1996 11:55:03 GMT
About mod_env.c (David, RobH), let's say you configured the server like this:

	SetEnv FOO foo
	<VirtualHost www.another.host>
	SetEnv BAR bar
	</VirtualHost>

What *should* this mean?

1)	The default server sees $FOO
	www.another.host sees $BAR (but not $FOO)
	ie: virtual hosts don't inherit environment specification
	from the default server.

2)	The default server sees $FOO
	www.another.host sees $BAR (and also sees $FOO)
	ie: virtual hosts do inherit environment specification from
	the default server.

The way mod_env.c works now (version 0.0.4) is that

	virtual hosts do inherit environment specification 
        from the default server EXCEPT when they define their own
	environment details, in which case the default server's
	environment spec is overridden.

so the following spec will allow the VH to see $FOO:

	SetEnv FOO foo
	<VirtualHost www.another.host>
	</VirtualHost>

but this spec *won't* allow the VH to see $FOO:

	SetEnv FOO foo
	<VirtualHost www.another.host>
	SetEnv BAR bar
	</VirtualHost>

Note that defining $BAR in www.another.host's environment doesn't
just override the $BAR definition (if there is one) from the default
server; it overrides ALL environment spec.  If it didn't behave
this way then I'd have to introduce an UnsetEnv directive which
could be used by VirtualHosts to deliberately screen out certain
environment variables that the admin didn't want the VH to know
about.  'UnsetEnv FOO' and 'SetEnv FOO ""' are *not* the same thing.
Meaning something like: [imagined code follows...]

	# everyone sees this
	SetEnv FOO foo
	# only a few see this
	SetEnv SOMETIMES sometimes
	<VirtualHost www.another.host>
		# same as default server
	</VirtualHost>
	<VirtualHost www.another.host>
		# special case, doesn't see all of the default settings
		UnsetEnv SOMETIMES	
	</VirtualHost>

This, imagined, configuration has the same effect as 0.0.4's:

	# everyone sees this
	SetEnv FOO foo
	# only a few see this
	SetEnv SOMETIMES sometimes
	<VirtualHost www.another.host>
		# same as default server, including SOMETIMES
	</VirtualHost>
	<VirtualHost www.another.host>
		# special case, doesn't see all of the default settings
		SetEnv FOO foo
	</VirtualHost>

[pause for breath...]

Ok.  So if it makes sense for VHs to 'inherit' the default server's
environment and be able to extend it with additional SetEnv/PassEnv
directives, then UnsetEnv should also be available to allow admins
to tune-out certain default server environment settings.

Or did I just say that?

David, does this seem fair?  RobH is this going to break your gear?

Ay. 	(I find I need to run-off 3 or four emails before breakfast, 
	just to warm up.)


Mime
View raw message