You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Keith Sawmiller <k_...@yahoo.com> on 2007/11/24 06:31:37 UTC
[users@httpd] Win32 Apache 2.2.6 Allow from env= issue
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.
Any help is appreciated.
---------------------------------
Get easy, one-click access to your favorites. Make Yahoo! your homepage.
Re: [users@httpd] Win32 Apache 2.2.6 Allow from env= issue
Posted by Keith Sawmiller <k_...@yahoo.com>.
Joshua,
That was the problem. I have not tried setting the environment variables via PHP yet, but it does behave properly now in my test case.
Thanks for the help.
Joshua Slive <jo...@slive.ca> wrote:
On Nov 24, 2007 12:31 AM, Keith Sawmiller 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
>
> Options FollowSymLinks
> AllowOverride None
> Order allow,deny
> allow from env=TEST_VAR
>
>
> ******************** BUT ******
> changing "env=TEST_VAR" to "all" grants access, shown below:
>
> SetEnv TEST_VAR
>
> Options FollowSymLinks
> AllowOverride None
> Order allow,deny
> allow from all
>
>
> 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 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
---------------------------------
Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now.
Re: [users@httpd] Win32 Apache 2.2.6 Allow from env= issue
Posted by Joshua Slive <jo...@slive.ca>.
On Nov 24, 2007 12:31 AM, Keith Sawmiller <k_...@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