httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart McGraw <smcg4...@frii.com>
Subject [users@httpd] SetEnv not doing what I'd hoped
Date Mon, 18 Jun 2012 01:12:53 GMT
I am having a problem get SetEnv to work (at least 
as I think it is supposed to).  I have some python 
cgi scripts that start with:

  #!/usr/bin/env python

I cannot (for logistical reasons) change these scripts.
However, the system python in /usr/bin/ is an old version
that the scripts will not run correctly with.

I installed a new version of python in /opt/python/
and added a SetEnv option to change PATH, putting the 
new python interpreter directory first:

  ScriptAlias /mydir/cgi/ /home/stuart/devel/web/cgi/
  Alias       /mydir/     /home/stuart/devel/web/
  <Directory /home/stuart/devel/web>
    SetEnv PATH /opt/python/bin:/usr/bin:/bin
    ...other stuff...
    </Directory>

I confirmed that the new python is installed ok, runs correctly
when I set my own path as above, etc.  

However, when I put a cgi script that prints its environment
variables in the web directory, and view it with a browser, 
it shows the PATH has not been changed (and the old interpreter 
is executing it.)  The config section above does and has been 
working fine (except the the wrong python is executed.)

Am I doing something wrong?  How can I get this to work?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message