From: Divye K. <div...@gm...> - 2008-09-23 21:05:12
|
On Wed, Sep 24, 2008 at 2:21 AM, Glyn Matthews <gly...@gm...>wrote: > Hi, > > 2008/9/23 Divye Kapoor <div...@gm...> > >> >> Do all python scripts in the cgi-bin directory have execute permissions >> for *all* users? I seem to remember that the linux version of CGIHTTPServer >> runs the CGI scripts with a uid of nobody and that might create permission >> issues in some cases. Also, are there any errors in the python log window? >> >> > > This is the trace I get: > <log snipped> > > > Traceback (most recent call last): > File "/usr/lib/python2.5/CGIHTTPServer.py", line 251, in run_cgi > os.execve(scriptfile, args, os.environ) > </log snipped> Permissions problem. Make sure that all cgi-bin scripts are world readable and world executable. Also, all directories in their path are world readable and executable. These scripts are accessed with a userid of "nobody" (uid usually ~65000) so the .py files have to be executable by the "others" permission group and the directory in which they are contained has to have permissions for "others" to access them. Basically you have to allow everybody to access them so that "nobody" can execute them. Rather a bad pun, I must say... :-) > > I think I missed why you're setting the HTTP_ALL_HEADERS environment > variable. How is this supposed to work? > HTTP_ALL_HEADERS is being set so that we can echo the headers back to the user in their raw form. The new http_server simply concatenates the headers received in the raw form into an env. variable before handing over processing to the python library's CGIHTTPServer. This env. variable is accessed in the echo_headers.py and echoed back to the client. > Glyn > > Hope that helped, Divye -- An idealist is one who, on noticing that a rose smells better than a cabbage, concludes that it will also make better soup. H. L. Mencken (1880 - 1956) My official web site: http://people.iitr.ernet.in/shp/061305/ Webmaster: http://www.drkapoorsclinic.com Blog: http://divyekapoor.blogspot.com |