求助,关于django部署: 测试网站的admin打不开(apache mod_wsgi)

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
silegon
帖子: 16
注册时间: 2007-12-14 20:16
来自: xiangtan hunan china
联系:

求助,关于django部署: 测试网站的admin打不开(apache mod_wsgi)

#1

帖子 silegon » 2009-07-17 10:20

django:1.02
apache2:2.2.11
mod-wsgi:2.5
django的admin在测试服务器下打开没问题,部署到apache上后,打开http://www.django.com/blog/ 没问题,打开http://www.django.com/admin/有问题
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] 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.
Apache/2.2.11 (Ubuntu) mod_wsgi/2.5 Python/2.6.2 Server at http://www.django.com Port 80
我的项目位置:/home/administrator/test/mysite
相关文件:
/etc/hosts
administrator@ubuntu:/etc/apache2/sites-available$ cat /etc/hosts
127.0.0.1 localhost
127.0.0.1 http://www.django.com
127.0.0.1 edunuke.firehare.com http://www.firehare.com
127.0.1.1 ubuntu.ubuntu-domain ubuntu

代码: 全选

administrator@ubuntu:/etc/apache2/sites-available$ cat django
NameVirtualHost *:80
<VirtualHost *:80>

    ServerName www.django.com
    ServerAdmin [email protected]
    
    WSGIDaemonProcess domain display-name=%{GROUP} maximum-requests=10000
    WSGIProcessGroup domain


    WSGIScriptAlias / /home/administrator/test/mysite/wsgi/mod.wsgi


    Alias /media/ "/home/administrator/test/mysite/media/"
    <Directory /home/administrator/test/mysite/>
        Order deny,allow
        Allow from all
    </Directory>

    ErrorLog "/var/log/apache2/django_errors.log"
    CustomLog "/var/log/apache2/django_accesses.log" common   
</VirtualHost>

代码: 全选

administrator@ubuntu:/etc/apache2$ cat ports.conf

Listen 80

代码: 全选

administrator@ubuntu:~/test/mysite$ pwd
/home/administrator/test/mysite
administrator@ubuntu:~/test/mysite$ cat urls.py
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    (r'^admin/(.*)', admin.site.root),
    url(r'^blog/',include('mysite.blog.urls')),
)

代码: 全选

administrator@ubuntu:~/test/mysite/wsgi$ cat mod.wsgi
import os,sys
sys.path.append('/home/administrator/test')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
头像
oneleaf
论坛管理员
帖子: 10454
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

Re: 求助,关于django部署: 测试网站的admin打不开(apache mod_wsgi)

#2

帖子 oneleaf » 2009-07-17 10:36

打开DEBUG,看错误原因。
回复