0

I'm running into this error message while deploying django in apache2 using mod_wsgi and i cannot fix it:

tail -f /var/log/apache2/error.log
[Tue Dec 20 04:15:45 2011] [info] mod_wsgi (pid=3959): Adding '/usr/local/lib/python2.7/site-packages/' to path.
[Tue Dec 20 04:15:45 2011] [info] [client 80.226.1.7] mod_wsgi (pid=3959, process='', application='digitalchaot.de|/djangu'): Loading WSGI script '/home/webapps/digitalchaot/apache.wsgi'.
[Tue Dec 20 04:16:04 2011] [error] [client 80.226.1.7] mod_wsgi (pid=3959): Exception occurred processing WSGI script '/home/webapps/digitalchaot/apache.wsgi'.
[Tue Dec 20 04:16:04 2011] [error] [client 80.226.1.7] Traceback (most recent call last):
[Tue Dec 20 04:16:04 2011] [error] [client 80.226.1.7]   File "/usr/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 284, in __call__
[Tue Dec 20 04:16:04 2011] [error] [client 80.226.1.7]     start_response(status, response_headers)
[Tue Dec 20 04:16:04 2011] [error] [client 80.226.1.7] TypeError: expected byte string object for status, value of type str found
[Tue Dec 20 04:16:04 2011] [error] [client 80.226.1.7] File does not exist: /htdocs
[Tue Dec 20 04:20:11 2011] [error] [client 207.46.13.206] File does not exist: /htdocs
[Tue Dec 20 04:20:57 2011] [error] [client 207.46.13.206] File does not exist: /htdocs

I'm running Debian with Python 2.7.2 with Django 1.3.1 and the current mod_wsgi. I compiled python, django and wsgi myself due to previous errors. Does anybody have a hint what the error might be ?

2
  • Could you also post the apache configuration for your site? Commented Dec 20, 2011 at 4:10
  • A hint might be that somewhere in your apache config, you are referring to /htdocs as a location of static content, and that location doesnt exist? Commented Dec 20, 2011 at 4:21

1 Answer 1

2

For the Python error, it looks like your mod_wsgi is compiled against Python 3.1 and not Python 2.7. You need to ensure that mod_wsgi which is installed was compiled against Python 2.7.

The clue is that error message is complaining that status is a byte string instead of text string. This can only occur in Python 3.X with mod_wsgi.

Go through the checks in this document:

http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation

Sign up to request clarification or add additional context in comments.

1 Comment

thank you. i don't know where the wrong wsgi version came from, but i removed it and compiled it again. not everything seems to work just fine :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.