configuring mxCGIPython

paul at boddie.net paul at boddie.net
Thu Apr 25 07:55:30 EDT 2002


On Thu, 25 Apr 2002 13:01:00 +0200 "M.-A. Lemburg" <mal at lemburg.com> wrote:
>
>Note that in order for the web server to execute the cgipython
>binary, the web server user must be able to cd to the directory
>where the binary lives.

This may explain a number of things.

>Depending on where you install the binary, this may not be the
>possible. The only way around this is either finding a directory
>which the web server user account can read or to install cgipython
>in a sub-dir of cgi-bin/ which is protected against access through the
>web server using e.g. an .htaccess file (depends on the web server
>being used).

Yes, this would appear to be a solution, and I'm tempted to use that instead of 
my existing wrapper approach which is also forced to use an .htpasswd protected 
directory, albeit one in the public HTML documents space. That's certainly a 
problem with budget hosting - it's probably rare to be given non-public 
directories where programs can be stored.

>> I found that it isn't always possible to deploy Python programs in a
>> cgi-bin directory and to use the above notation to persuade the
>> operating system to locate the Python executable. In the end, I used a
>> wrapper shell script for each of my Python programs.
>
>This should not be necessary if the directory permission
>are right... but I may be wrong.

Could there also be some mechanism which prevents arbitrary paths from being 
used after #! - a list of trusted "shells", for example?

Paul





More information about the Python-list mailing list