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.
Best Answer
That's a CGI script. Enable CGI on the server, call the script
whatever.py
, put it in thecgi-bin/
directory, and go tohttp://somehost.ex/cgi-bin/whatever.py
.