As first step, enable DEBUG mode in Django settings module to see if that fixes 
the issue or at least causes a description of the error in the browser.

It is quite common to get a 500 error response delivered back from Django with 
no record of the exception being logged. This is because Django doesn’t log 
exception details by default.

Graham

> On 26 Nov 2015, at 9:34 PM, Arjan van Eersel <[email protected]> 
> wrote:
> 
> I'm trying to deploy a Django site through apache 2 as a wsgi daemon. Yet I 
> keep getting an error 500 message, but no message in the apache logs at all. 
> How can I get more information on what causes this error?
> 
> I also made a quick helloworld wsgi app to test, here everything goes fine, 
> so the problem seems to be related to the django app. The server uses 
> virtualmin for management of the virtual host. And I've searched (and found) 
> many related issues on the internet, still whatever I try I can't fix this 
> problem. The irony is that I can run other instances of the same app without 
> any problems on the same server. There are 3 other sites running on exactly 
> the same app on the same server.
> 
> Virtual host settings:
> SuexecUserGroup "#1237" "#1136"
> ServerName aldeimbg.org
> ServerAlias www.aldeimbg.org
> ServerAlias webmail.aldeimbg.org
> ServerAlias admin.aldeimbg.org
> ServerAlias autoconfig.aldeimbg.org
> 
> #LogLevel debug
> 
> Alias /static  /home/aldeimbg/python/BalkanCMS/static
> <Directory /home/aldeimbg/python/BalkanCMS/static>
>    Order deny,allow
>    Allow from all
> </Directory>
> 
> Alias /media  /home/aldeimbg/python/UserContent/media
> <Directory /home/aldeimbg/python/UserContent/media>
>    Order deny,allow
>    Allow from all
> </Directory>
> 
> WSGIDaemonProcess aldeimbg.org 
> python-path=/home/aldeimbg/env/lib/python2.7/site-packages
> WSGIProcessGroup aldeimbg.org
> WSGIApplicationGroup %{GLOBAL}
> WSGIScriptAlias / /home/aldeimbg/python/BalkanCMS/wsgi.py
> WSGIPassAuthorization On
> 
> <Directory /home/aldeimbg/python/BalkanCMS>
>    #Require all granted
>    Order allow,deny
>    Allow from all 
> </Directory>
> 
> ErrorLog /var/log/virtualmin/aldeimbg.org_error_log
> CustomLog /var/log/virtualmin/aldeimbg.org_access_log combined
> ScriptAlias /cgi-bin/ /home/aldeimbg/cgi-bin/
> ScriptAlias /awstats/ /home/aldeimbg/cgi-bin/
> ScriptAlias /AutoDiscover/AutoDiscover.xml 
> /home/aldeimbg/cgi-bin/autoconfig.cgi
> ScriptAlias /Autodiscover/Autodiscover.xml 
> /home/aldeimbg/cgi-bin/autoconfig.cgi
> ScriptAlias /autodiscover/autodiscover.xml 
> /home/aldeimbg/cgi-bin/autoconfig.cgi
> 
> <Directory /home/aldeimbg/cgi-bin>
> allow from all
> AllowOverride All 
> Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
> </Directory>
> RewriteEngine on
> RewriteCond %{HTTP_HOST} =webmail.aldeimbg.org
> RewriteRule ^(.*) https://aldeimbg.org:20000/ [R]
> RewriteCond %{HTTP_HOST} =admin.aldeimbg.org
> RewriteRule ^(.*) https://aldeimbg.org:10000/ [R]
> RemoveHandler .php
> RemoveHandler .php5
> php_admin_value engine Off
> IPCCommTimeout 31
> FcgidMaxRequestLen 1073741824
> <Files awstats.pl>
> AuthName "aldeimbg.org statistics"
> AuthType Basic
> AuthUserFile /home/aldeimbg/.awstats-htpasswd
> require valid-user
> </Files>
> Alias /dav /home/aldeimbg/public_html
> Alias /pipermail /var/lib/mailman/archives/public
> <Location /dav>
> DAV on
> AuthType Basic
> AuthName "aldeimbg.org"
> AuthUserFile /home/aldeimbg/etc/dav.digest.passwd
> Require valid-user
> ForceType text/plain
> Satisfy All
> RemoveHandler .php
> RemoveHandler .php5
> RewriteEngine off
> </Location>
> RedirectMatch /cgi-bin/mailman/([^/\.]*)(.cgi)?(.*) 
> https://aldeimbg.org:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
> RedirectMatch /mailman/([^/\.]*)(.cgi)?(.*) 
> https://aldeimbg.org:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
> Redirect /mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
> 
> wsgi.py:
> 
> """
> WSGI config for BalkanCMS project.
> 
> It exposes the WSGI callable as a module-level variable named ``application``.
> 
> For more information on this file, see
> https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
> """
> 
> import os
> import sys
> 
> sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 
> "../../")))
> sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 
> "../")))
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "BalkanCMS.settings")
> 
> from django.core.wsgi import get_wsgi_application
> application = get_wsgi_application()
> 
> settings.py
> 
> DEBUG = True (tried with False too, but get the same error)
> 
> TEMPLATE_DEBUG = True
> 
> ALLOWED_HOSTS = ['*',]
> 
> I can access the app through manage.py runserver without problems
> 
> Apache version info:
> Server version: Apache/2.2.22 (Ubuntu)
> Server built:   Jul 24 2015 17:25:42
> Server's Module Magic Number: 20051115:30
> Server loaded:  APR 1.4.6, APR-Util 1.3.12
> Compiled using: APR 1.4.6, APR-Util 1.3.12
> Architecture:   64-bit
> Server MPM:     Prefork
>   threaded:     no
>     forked:     yes (variable process count)
> Server compiled with....
>  -D APACHE_MPM_DIR="server/mpm/prefork"
>  -D APR_HAS_SENDFILE
>  -D APR_HAS_MMAP
>  -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
>  -D APR_USE_SYSVSEM_SERIALIZE
>  -D APR_USE_PTHREAD_SERIALIZE
>  -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
>  -D APR_HAS_OTHER_CHILD
>  -D AP_HAVE_RELIABLE_PIPED_LOGS
>  -D DYNAMIC_MODULE_LIMIT=128
>  -D HTTPD_ROOT="/etc/apache2"
>  -D SUEXEC_BIN="/usr/lib/apache2/suexec"
>  -D DEFAULT_PIDLOG="/var/run/apache2.pid"
>  -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
>  -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
>  -D DEFAULT_ERRORLOG="logs/error_log"
>  -D AP_TYPES_CONFIG_FILE="mime.types"
>  -D SERVER_CONFIG_FILE="apache2.conf"
> 
> mod_wsgi version
> ii  libapache2-mod-wsgi                   3.3-4ubuntu0.2                      
>   Python WSGI adapter module for Apache
> 
> Python version: 2.7.3
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at http://groups.google.com/group/modwsgi 
> <http://groups.google.com/group/modwsgi>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to