Python as serverside

software development

#1

I tried running a Python file on my server, and failed.

http://www.destroi.com/hello.py

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@destroi.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I wrote the file using the command line and it’s chmod’d to 755…


#2

I’m not a Python programmer, but my bets are you’ve got a typo of some sort in your .htaccess file.


#3

no .htaccess file is uploaded on destroi.com


#4

What does your error log say? (~/logs/destroi.com/http/error.log)


If you want useful replies, ask smart questions.


#5

Ah. Does Apache module and/or CGI handle python by default? (…and are you running as CGI?) If not, you may wanna try putting an .htaccess file in the directory and adding something like:AddHandler python-program .py PythonHandler mpt PythonDebug On…to its contents. And again, I’ve never used Python, so this suggestion might be completely useless.


#6

Have you double checked your shebang! line to make sure you are calling the correct instance/version of python for your script? DH as several versions (last time I checked) installed.

–rlparker


#7

the python file I’m executing has no line indicating it’s a python file, such as <??> for php, I think that may be the problem.