Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

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

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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