How can I run python scripts on my webserver?
I have a test script, /var/www/etym/cgi-bin/test.py
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# enable debugging
import cgitb
cgitb.enable()
print "Content-Type: text/plain;charset=utf-8"
print "Hello World!"
And I'm trying to run it by going to http://localhost/etym/cgi-bin/test.py
in my browser, but it's not working--Firefox just asks me whether I'd like
to open the file with gedit or save it to the disk. What do I need to do
to get it to run? I already ran chmod +x on the script.
No comments:
Post a Comment