Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 56878 invoked from network); 24 Nov 2007 21:50:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Nov 2007 21:50:04 -0000 Received: (qmail 45799 invoked by uid 500); 24 Nov 2007 21:49:41 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 45781 invoked by uid 500); 24 Nov 2007 21:49:41 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 45770 invoked by uid 99); 24 Nov 2007 21:49:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Nov 2007 13:49:41 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [66.163.178.120] (HELO web34205.mail.mud.yahoo.com) (66.163.178.120) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 24 Nov 2007 21:49:20 +0000 Received: (qmail 96506 invoked by uid 60001); 24 Nov 2007 21:49:20 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=rVrBXI3Tshfz0loMY4vyKx0oAwZIHXe0AQuYl+v6Fc+hhnxAKLvU0CdCsNFzkPM/BhP256cPJ6dAbTYDxxqxcG2ci2zdsIx01rzWcxcpItrY4BtSPCyrqmVTfJkYebE8+opqdtAD0tlaAKng/Adg4ipTXIMa3Lhj8VlaEgHBxm0=; X-YMail-OSG: LAppmWwVM1n9CTeI6EnLygoynLEFtn13ast.VICk Received: from [76.250.132.197] by web34205.mail.mud.yahoo.com via HTTP; Sat, 24 Nov 2007 13:49:20 PST Date: Sat, 24 Nov 2007 13:49:20 -0800 (PST) From: Keith Sawmiller To: users@httpd.apache.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-820213716-1195940960=:95816" Content-Transfer-Encoding: 8bit Message-ID: <523043.95816.qm@web34205.mail.mud.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Win32 Apache 2.2.6 Allow from env= issue --0-820213716-1195940960=:95816 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 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. --0-820213716-1195940960=:95816 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
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 <joshua@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. --0-820213716-1195940960=:95816--