I recently re-installed my Ubuntu PC (to 12.04) & had to re-setup apache.
local.domain.com points to localhost (virtual host).
http://local.domain.com/script.py?query=string
script.py is chmod’d to 755.
In my .htaccess I have :
Options +ExecCGI
AddHandler cgi-script .py
But I get a 500 : Internal Server Error.
cat /var/log/apache2/error.domain.com.log shows nothing.
If I do python script.py in the command line I get :
<!-- The above is a description of an error in a Python program, formatted
for a Web browser because the 'cgitb' module was enabled. In case you
are not reading this in a Web browser, here is the original traceback:
Traceback (most recent call last):
File "script.py", line 32, in <module>
queryHash = hashlib.sha224(os.environ['QUERY_STRING']).hexdigest()
File "/usr/lib/python2.7/UserDict.py", line 23, in __getitem__
raise KeyError(key)
KeyError: 'QUERY_STRING'
-->
So I don’t figure anything wrong with the py script. It used to work before.
But for some reason its not executing in the browser.
What else could I have missed ?
Ubuntu 12.04 has python 2.7. My script’s shebang line was :