Mod_python Internal Server Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or 500 internal server error python cgi posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss apache python cgi internal server error Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes
Python 500 Error
a minute: Sign up How do you trace 500 server errors with Apache + mod_python + Django? [duplicate] up vote 5 down vote favorite Possible Duplicate: Django Unhandled Exception I'm randomly getting 500 server errors and trying to diagnose the
End Of Script Output Before Headers Python
problem. The setup is: Apache + mod_python + Django My 500.html page is being served by Django, but I have no clue what is causing the error. My Apache access.log and error.log files don't contain any valuable debugging info, besides showing the request returned a 500. Is there a mod_python or general python error log somewhere (Ubuntu server)? Thanks! django apache mod-python share|improve this question edited Nov 18 '15 at 14:59 pnuts 33.9k63769 asked Jan 10 '10 at 5:52 Andrew C 648719 500 python gun marked as duplicate by Tim Cooper, Bill the Lizard Jul 27 '12 at 11:26 This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. add a comment| 2 Answers 2 active oldest votes up vote 3 down vote Yes, you should have an entry in your apache confs as to where the error log is for the virtual server. For instance the name of my virtual server is djangoserver, and in my /etc/apache2/sites-enabled/djangoserver file is the line ErrorLog /var/log/apache2/djangoserver-errors.log Although now that I reread your question, it appears you already have the apache log taken care of. I don't believe there is any separate log for mod_python or python itself. Is this a production set up? If not you might wish to turn on Debug mode, and then Django produces very detailed screens with the error information. In your project's settings.py, set DEBUG = True TEMPLATE_DEBUG = DEBUG to disable the generic 500 error screens and see the detailed breakdown. share|improve this answer answered Jan 10 '10 at 6:10 JAL 14.7k13254 Thanks for the response. I have read the Apache error log, but the information is not very valuable. Yes, this is a production environment so I'd prefer not to turn DEBUG on. The tough part is that I am not seeing the errors, but customers randomly are. So I am trying to retroactively di
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us
How To Fix 500 Internal Server Error
Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Getting python to work, Internal Server Error up vote http://stackoverflow.com/questions/2036260/how-do-you-trace-500-server-errors-with-apache-mod-python-django 6 down vote favorite 2 I'm trying to get Python scripts, called from a web browser, to work. I keep getting the error: 500 Internal Server Error When I check my error logs I see the message Premature end of script headers The only documentation of this error online says that it can be the result of having improper line return characters in your script, but I http://stackoverflow.com/questions/378811/getting-python-to-work-internal-server-error wrote my test script right from the shell with pico. Also, when I run the file from the command line it executes just fine. " So far the only change I have made to apache is to add the .py to the "AddHandler cgi-script" line. Thanks! Thanks for the quick responses. Here is the latest version of the test code. I added a couple new lines before the output as suggested but still get the same error: #!/usr/local/bin/python print "Content-type: text/html\n" print "\n\n" print "" print "
" print "Hi there.
" print "" print "" Some other details: I am running Apache 1.3 and don't have mod_python. I set apache to recognize .py as mentioned above. I am running the script from the main public_html folder. An update. It doesn't seem to matter what I put in the shebang line. I tried all of the suggestions and even if I leave it blank the same error is showing up in the errors log and I'm getting a 500 error. I'm running Apache/1.3.41 on linux (red hat 3.4) with WHM/Cpanel installed. python share|improve this question edited Oct 5 '11 at 2:09 Bill the Lizard 223k139448737 asked DStart here for a quick overview of the site Help Center Detailed answers to any questions you might http://serverfault.com/questions/435515/500-internal-server-error-when-setting-up-apache-on-ubuntudjango have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it internal server only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top 500 Internal Server Error when setting up Apache on Ubuntu+Django up vote 0 down vote favorite I tried with Apache on ubuntu 9.04 and get the same internal server error error: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@localhost 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. And my apache/error.log is: [Sat Oct 06 09:32:04 2012] [error] [client 10.0.64.10] ServerName: 'sapint2' [Sat Oct 06 09:32:04 2012] [error] [client 10.0.64.10] DocumentRoot: '/etc/apache2/htdocs' [Sat Oct 06 09:32:04 2012] [error] [client 10.0.64.10] URI: '/' [Sat Oct 06 09:32:04 2012] [error] [client 10.0.64.10] Location: '/' [Sat Oct 06 09:32:04 2012] [error] [client 10.0.64.10] Directory: None [Sat Oct 06 09:32:04 2012] [error] [client 10.0.64.10] Filename: '/etc/apache2/htdocs' [Sat Oct 06 09:32:04 2012] [error] [client 10.0.64.10] PathInfo: '/' [Sat Oct 06 09:32:04 2012] [error] [client 10.0.64.10] Traceback (most recent call last): [Sat Oct 06 09:32:04 2012] [error] [client 10.0.64.10] File "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch\n default=default_handler, arg=req, silent=hlist.silent) [Sat Oct 06