Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

DO NOT REPLY [Bug 16657] New: - SetEnv doesn't seem to work inside <Files>

From: <bugzilla(at)apache.org>
Date: Fri Jan 31 2003 - 17:42:39 EST


DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16657>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16657

SetEnv doesn't seem to work inside <Files>

           Summary: SetEnv doesn't seem to work inside 
           Product: Apache httpd-2.0
           Version: 2.0.44
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: mod_cgi
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: jhmark@xenops.com

When I put a SetEnv directive inside a <Files> section which identifies a CGI script, the environment variable is not set when the script is run. If I move the SetEnv into a <Directory> section for the directory the script is in, then it works as expected.

Example:
Create directories htdocs/dir1, htdocs/dir2. Copy test.sh (see below) into htdocs/dir1 and htdocs/dir2, make it executable. Put example text into your httpd.conf (see below). Go to http://localhost/test1 ... note that the value of FOO is shown as empty. Go to http://localhost/test2 ... note that the correct value is shown.

  • here is test.sh #!/bin/sh echo Content-type: text/plain echo echo value of FOO environment variable is: $FOO
  • here is what to put in httpd.conf ScriptAlias /test1 /YOURPATH/htdocs/dir1/test.sh ScriptAlias /test2 /YOURPATH/htdocs/dir2/test.sh
    <Files /YOURPATH/htdocs/dir1/test.sh>
    Options ExecCGI SetEnv FOO value_of_foo
    </Files>
    <Files /YOURPATH/htdocs/dir2/test.sh>
    Options ExecCGI
    </Files>
    <Directory /YOURPATH/htdocs/dir2/>
    SetEnv FOO value_of_foo
    </Directory>


To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org For additional commands, e-mail: bugs-help@httpd.apache.org Received on Fri Jan 31 22:41:07 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 16:44:21 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library