OK, I just ran into an error, I'm thinking I should post up here, since I found the resolution, as well as ask a few questions (at the bottom):
I was getting an Error 403 Forbidden. I checked the server logs, and it said that I hadn't enabled ExecCGI.
A small google search later, ExecCGI is an Option you can set in Apache. It was off, for me. I added Option ExecCGI, to whichever <Directory> I needed, and it gave me the SAME error, but I noticed I coudl twiddle it, depending on what the content I was "print" ing was.
I took another look at the server logs, and found out I was sending bad headers. I took a look at http://www.bel-epa.com//pyapache/'s example of a 'minimalist example', and copy paste, and it worked.
(Since it's a minimalist example, I'll post it here:
Now, my only question is - if I foob up my traceback, it reports it to the error log. is there anyway to pipe that to the output of the script? Or do I have to scrounge through the server logs every time?
Also, is there any way I can detect that I'm running this from the web, versus from the command line? Some variable, or some such I can test?
Cheers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK, I just ran into an error, I'm thinking I should post up here, since I found the resolution, as well as ask a few questions (at the bottom):
I was getting an Error 403 Forbidden. I checked the server logs, and it said that I hadn't enabled ExecCGI.
A small google search later, ExecCGI is an Option you can set in Apache. It was off, for me. I added Option ExecCGI, to whichever <Directory> I needed, and it gave me the SAME error, but I noticed I coudl twiddle it, depending on what the content I was "print" ing was.
I took another look at the server logs, and found out I was sending bad headers. I took a look at http://www.bel-epa.com//pyapache/'s example of a 'minimalist example', and copy paste, and it worked.
(Since it's a minimalist example, I'll post it here:
print "Content-type: text/plain\r\n\r\n"
print "Hello, world"
)
Now, my only question is - if I foob up my traceback, it reports it to the error log. is there anyway to pipe that to the output of the script? Or do I have to scrounge through the server logs every time?
Also, is there any way I can detect that I'm running this from the web, versus from the command line? Some variable, or some such I can test?
Cheers