目前文件结构如下
--proj
|-----proj (自动建立的)
|-----qcsa (自己建的app)
|-----manage.py
|-----apache2 (用来存放django.wsgi)
整个目录存放在/var/www/下
用manage runserver运行完全没有问题
但是用apache2+wsgi的时候访问总是报500错误
整个项目的配置文件当用runserver运行成功后 只去掉了debug信息
根据网上的一些资料 目前配置如下
但总是在访问的时候报出500错误 求解决方法
机器使用ubuntu11.04
经测试wsgi模块正常
求解决方法
这是apache2的default的内容
<VirtualHost *:80>
ServerName 127.0.0.1
DocumentRoot /var/www/qcsa
<Directory /var/www/qcsa>
Order allow,deny
Allow from all
</Directory>
WSGIDaemonProcess qcsa.djangoserver processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup qcsa.djangoserver
WSGIScriptAlias / /var/www/qcsa/apache/django.wsgi
</VirtualHost>
这是django.wsgi的内容
import os
import sys
path = '/var/www'
if path not in sys.path:
sys.path.insert(0, '/var/www')
os.environ['DJANGO_SETTINGS_MODULE'] = 'proj.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
报错信息如下:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [no address given] 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.
--proj
|-----proj (自动建立的)
|-----qcsa (自己建的app)
|-----manage.py
|-----apache2 (用来存放django.wsgi)
整个目录存放在/var/www/下
用manage runserver运行完全没有问题
但是用apache2+wsgi的时候访问总是报500错误
整个项目的配置文件当用runserver运行成功后 只去掉了debug信息
根据网上的一些资料 目前配置如下
但总是在访问的时候报出500错误 求解决方法
机器使用ubuntu11.04
经测试wsgi模块正常
求解决方法
这是apache2的default的内容
<VirtualHost *:80>
ServerName 127.0.0.1
DocumentRoot /var/www/qcsa
<Directory /var/www/qcsa>
Order allow,deny
Allow from all
</Directory>
WSGIDaemonProcess qcsa.djangoserver processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup qcsa.djangoserver
WSGIScriptAlias / /var/www/qcsa/apache/django.wsgi
</VirtualHost>
这是django.wsgi的内容
import os
import sys
path = '/var/www'
if path not in sys.path:
sys.path.insert(0, '/var/www')
os.environ['DJANGO_SETTINGS_MODULE'] = 'proj.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
报错信息如下:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [no address given] 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.