I'm struggling badly with mod_wsgi, python3, and django on fedora30.  Seems
like everything is working alone, but I cannot get mod_wsgi to work with
django, if that makes any sense.  In other words my django app works from
runserver, and I can see the whiskey image from mod_wsgi, and can serve a
simple python script with mod_wsgi, but cannot get the django production
server approach working for my app using mod_wsgi with httpd (apache).

I've put my app (hawmusarchive) in several places to test such as
/opt/hawmusarchive, or /var/www/hawmusarchive, or
/var/www/html/hawmusarchive but all seem to get the internal server error
so am appending httpd server log below which is showing issues with
wsgi.py.  I've checked permissions/ownership (777, apache:apache) on

I'm not using venev, and am wondering if django being in
/usr/lib/python3.7/site-packages (32bit), and mod_wsgi installed in
/usr/lib64/python3.7/site-packages (64 bit) is confusing it for some reason?

I've worked thru my config.d file for wsgi alias, vhost carefully, and list
it way below if somehow I buggered it to provoke the internal server error.

Any help/hints very greatly appreciated on perhaps where to keep looking.


EXCERPT from /var/log/httpd/error_logs:

[Mon Aug 19 15:00:13.855666 2019] [mpm_event:notice] [pid 5992:tid
140091650494784] AH00489: Apache/2.4.39 (Fedora) mod_wsgi/4.6.4 Python/3.7
configured -- resuming normal operations
[Mon Aug 19 15:00:13.855688 2019] [core:notice] [pid 5992:tid
140091650494784] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Aug 19 15:00:18.768792 2019] [wsgi:error] [pid 5997:tid
140091162883840] [client] mod_wsgi (pid=5997): Failed
to exec Python script file '/opt/hawmusarchive/hawmusarchive/wsgi.py'.
[Mon Aug 19 15:00:18.768873 2019] [wsgi:error] [pid 5997:tid
140091162883840] [client] mod_wsgi (pid=5997):
Exception occurred processing WSGI script
[Mon Aug 19 15:00:18.769468 2019] [wsgi:error] [pid 5997:tid
140091162883840] [client] Traceback (most recent call
[Mon Aug 19 15:00:18.769557 2019] [wsgi:error] [pid 5997:tid
140091162883840] [client]   File
"/opt/hawmusarchive/hawmusarchive/wsgi.py", line 16, in <module>
[Mon Aug 19 15:00:18.769566 2019] [wsgi:error] [pid 5997:tid
140091162883840] [client]     application =
[Mon Aug 19 15:00:18.769575 2019] [wsgi:error] [pid 5997:tid
140091162883840] [client]   File
"/usr/lib/python3.7/site-packages/django/core/wsgi.py", line 12, in
[Mon Aug 19 15:00:18.769613 2019] [wsgi:error] [pid 5997:tid
140091162883840] [client]
[Mon Aug 19 15:00:18.769621 2019] [wsgi:error] [pid 5997:tid
140091162883840] [client]   File
"/usr/lib/python3.7/site-packages/django/__init__.py", line 19, in setup
[Mon Aug 19 15:00:18.769626 2019] [wsgi:error] [pid 5997:tid
140091162883840] [client]
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Mon Aug 19 15:00:18.769633 2019] [wsgi:error] [pid 5997:tid
140091162883840] [client]   File
"/usr/lib/python3.7/site-packages/django/conf/__init__.py", line 57, in
[Mon Aug 19 15:00:18.769637 2019] [wsgi:error] [pid 5997:tid
140091162883840] [client]     self._setup(name)
[Mon Aug 19 15:00:18.769650 2019] [wsgi:error] [pid 5997:tid
140091162883840] [client]   File
"/usr/lib/python3.7/site-packages/django/conf/__init__.py", line 44, in
[Mon Aug 19 15:00:18.769656 2019] [wsgi:error] [pid 5997:tid
140091162883840] [client]     self._wrapped =
[Mon Aug 19 15:00:18.769673 2019] [wsgi:error] [pid 5997:tid
140091162883840] [client]   File
"/usr/lib/python3.7/site-packages/django/conf/__init__.py", line 107, in
[Mon Aug 19 15:00:18.769677 2019] [wsgi:error] [pid 5997:tid
140091162883840] [client]     mod =
[Mon Aug 19 15:00:18.769684 2019] [wsgi:error] [pid 5997:tid
140091162883840] [client]   File
"/usr/lib64/python3.7/importlib/__init__.py", line 127, in import_module


# httpd conf.d file for django.
# httpd.conf calls all conf.d files.

#this one was the system dnf install mod_wsgi-, from mod_wsgi-express-3
LoadModule wsgi_module "/usr/lib64/python3.7/site-packages/mod_wsgi/server/

#this is the actual apache module location:
#LoadModule wsgi_module "/etc/httpd/modules/mod_wsgi_python3.so"

WSGIPythonHome "/usr"  #pyhon3 is under /usr/lib/python3.7 etc.

<Directory "/opt/hawmusarchive/">
Require all granted

<VirtualHost *:80>
ServerName hawmusarchive.
        ServerAlias hawmusarchive.
DocumentRoot /var/www/html
<Directory /opt/hawmusarchive>
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
                Require all granted
#WSGIScriptAlias / "/var/www/html/hawmusarchive/hawmusarchive/wsgi.py"
WSGIScriptAlias / "/opt/hawmusarchive/hawmusarchive/wsgi.py"
<Directory "/opt/hawmusarchive/hawmusarchive">
<Files wsgi.py>
Require all granted
    Alias /robots.txt /opt/hawmusarchive/static/robots.txt
    Alias /favicon.ico /opt/hawmusarchive/static/favicon.ico

    Alias /media/ /opt/hawmusarchive/media/
    Alias /static/ /opt/hawmusarchive/static/

   <Directory /opt/hawmusarchive/static>
    Require all granted

   <Directory /opt/hawmusarchive/media>
   Require all granted


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 modwsgi+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to