httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <jos...@slive.ca>
Subject Re: [users@httpd] Win32 Apache 2.2.6 Allow from env= issue
Date Sat, 24 Nov 2007 15:10:57 GMT
On Nov 24, 2007 12:31 AM, Keith Sawmiller <k_sawmill@yahoo.com> wrote:
> I'm trying to restrict access to only instances where an environment
> variable is present (eventually to be set via PHP)
>
> This simple case (from httpd.conf) denies access:
>
> SetEnv TEST_VAR
> <Directory "Z:/Web Root">
>     Options FollowSymLinks
>     AllowOverride None
>     Order allow,deny
>     allow from env=TEST_VAR
> </Directory>
>
> ******************** BUT ******
> changing "env=TEST_VAR" to "all" grants access, shown below:
>
> SetEnv TEST_VAR
> <Directory "Z:/Web Root">
>     Options FollowSymLinks
>     AllowOverride None
>     Order allow,deny
>     allow from all
> </Directory>
>
> It seems like Apache is not passing the "env=TEST_VAR" test, even though
> everything I've found in the documentation and forums says this should work.

Try SetEnvIf instead. SetEnv acts during a different phase of
processing, which may be too late to make this work.

(You may have similar problems with trying to set an env variable in
php and use it in the apache config. I've never tried it myself.)

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message