我在Redhat服务器中配置了Django 1.4,mod_wsgi 2.0和apache 2.2.3。 但是,当我尝试访问服务器时出现以下错误: “错误500:内部服务器错误”。Django,mod_wsgi,Apache:内部服务器错误
[[email protected] hardi]# wget mritest.domain.ch
--2012-08-23 21:51:27-- http://mritest.domain.ch/
Resolving mritest.domain.ch... 127.0.0.1
Connecting to mritest.domain.ch|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2012-08-23 21:51:27 ERROR 500: Internal Server Error.
所以我有连接,但我没有得到任何有效的响应。 它取决于django版本,我应该使用Django 1.3进行部署吗?
编辑
Apache的错误日志:
[Thu Aug 23 22:34:04 2012] [error] [client 127.0.0.1] mod_wsgi (pid=7835): Exception occurred processing WSGI script '/home/django_www/hello/apache/django.wsgi'.
[Thu Aug 23 22:34:04 2012] [error] Traceback (most recent call last):
[Thu Aug 23 22:34:04 2012] [error] File "/home/django_www/hello/apache/django.wsgi", line 1, in <module> [Thu Aug 23 22:34:04 2012] [error] import os
[Thu Aug 23 22:34:04 2012] [error] ImportError: No module named os"
您是否检查过服务器日志以查看是否有任何相关的内容? – themanatuf
另外,在'settings.py'中将'DEBUG'更改为'False',然后重新加载Apache。如果日志中没有有用的错误,则在页面上会有一个启用了“DEBUG”的错误。 – supervacuo
是的,在服务器中没有出现任何有用的错误! – Kreshnik