I have a really simple Python script which I'd like to run on my Apache 2 server:

#!/usr/bin/python

print "Content-Type: text/html"
print

print "<html><head><title>Hello</title></head><body></body></html>"

How can I simply get this up and going on my Apache server? I'm not looking to do anything fancy, I just want something that works.

link|improve this question

1  
You forgot the ' World' after 'Hello'. It isn't official unless it is "Hello World". – Zoredache Oct 28 '11 at 7:41
If only it were that easy. – TK Kocheran Oct 28 '11 at 19:28
feedback

1 Answer

up vote 3 down vote accepted

That's a CGI script. Enable CGI on the server, call the script whatever.py, put it in the cgi-bin/ directory, and go to http://somehost.ex/cgi-bin/whatever.py.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.