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


print "Content-Type: text/html"

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.

  • 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. – Naftuli Kay Oct 28 '11 at 19:28

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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