Using Apache 2.2 on my local OSX machine, I;ve set up a virtual host to serve a directory that a project of mine is in. In this directory, I have some python .cgi scripts that I use to dynamically generated locally-used html code. In several places,scripts that work fine when not run as .cgi scripts via the webserver (but just as regular .py scripts in the Python interpreter) break when run by Apache because of what look like permissions related issues. Specifically:
1) When a script attempts to make a directory, it fails to do so unless writing is enabled on the superdirectory for all users, not just owner or group. I see a "permission denied" error via the cgitb output. and, 2) Some operating system stat modification functions, like os.utim, fail -- with the error message being that "Operation is Not Permitted". I've put permissions to 777 for all the involved files but to no avail. (Am I right in thinking that this problem is also a permissions issue? I know the first one is, because the error message says so explicitly.) My computer is running off-line and this only ever going to be a local development task. So, my basic question is: is there some way, for the directories that I'm serving, to turn of all the permissions protections whatsoever? E.g. to run my cgi scripts as if the process running the scripts had all root privileges? And so that I can run scripts via cgi without having to worry about problems like the "Operation Not Permitted Errror"? (I want to be able to take advantage of using pythong for dynamic web-page generation without worrying about permission and security issues, since these files will never be near anything online.) I've tried to do things like put the proper things in my Apache configuration files (e.g the virtual host conf fil, the httpd.conf file, etc...), but this failed to achieve my goal. I apologize if I'm sending this mail to the wrong list, Thanks, Dan
-- http://mail.python.org/mailman/listinfo/python-list