> I see this error in SCGI and Quixote logfiles a lot of times: ... > KeyError: 'SCRIPT_NAME' > > What can be wrong? Somehow os.environ['SCRIPT_NAME'] is not getting set or is getting deleted. mod_scgi always sets SCRIPT_NAME, as far as I know. You should put print statements along the apache -> your script path to see where it's going. You could put one in scgi.scgi_server.SCGIHandler.read_env to see if mod_scgi is passing SCRIPT_NAME at all. If not, you could make sure apache, in fact, sends it, and if not, printf mod_scgi.c, though I really have no idea how it would disappear in there. It's gotta be going somewhere, right? Or maybe it's an entirely different problem and the traceback is wrong (out of date .pyc?), or something else confusing.