Hi Graham,
Yes, not sure why fedora has two dirs for apache modules. one in /usr/lib64/httpd and the other in /etc/httpd/modules...both have same contents.
My django app (test_app) is located in /var/www/html
/var/www/html/test_app, and the project within test_app is just called test_app too.
I can see it in the browser using the development server by activating the virtualenv, cd'ing to /var/www/html/test_app
and running
>python manage.py runserver
or alternately
>python manage.py runmodwsgi
then go to the browser and enter
localhost:8000
to see the django rocket
or
localhost:8000/admin
to see the admin login page
But when I try to run the test_app as production server by going to the browser and typing
XXX.XXX.107.165/test_app (get 403 forbidden, you don't have permission...)
or
XXX.XXX.107.165/test_app/admin (get 404 URL not found on the server)
Below is my mod_wsgi.conf file from /etc/httpd/conf.d. I couldn't find any other place for vhost, so I'm thinking it goes in the same file.
Ownership and group of virtualenv is refstudent (me), with permissions 777 recursively
Ownership and group of /var/www/html is root:root
Ownership and group of test_app is apache:apache (recursively throughout) with permissions 777 throughout the app.
=======================
#/etc/http/conf.d/mod_wsgi.conf
WSGIPythonHome "/opt/myenv"
<VirtualHost *:80>
ServerName XXX.XXX.107.165
ServerAlias XXX.XXX.107.165
DocumentRoot /var/www/html
WSGIScriptAlias /XXX.XXX.107.165/test_app "/var/www/html/test_app/test_app/wsgi.py>
WSGIDaemonProcess test_app python-path=/var/www/html/test_app:/opt/myenv/lib/python3.9/site-packages:/opt/myenv/lib64/python3.9/site-packages
WSGIProcessGroup test_app
<directory /var/www/html/test_app>
AllowOverride all
Require all granted
Options FollowSymlinks
</directory>
Alias /static/ /var/www/html/test_app/static/
<Directory /var/www/html/test_app/static>
Require all granted
</Directory>
</VirtualHost>
Alias /static /var/www/html/test_app/static
<Directory /var/www/html/test_app/static>
Require all granted
</Directory>
<Directory "/var/www/html/test_app/test_app/">
<Files wsgi.py>
Require all granted
</Files>
</Directory>
Alias /robots.txt /var/www/html/test_app/static/robots.txt
Alias /favicon.ico /var/www/html/test_app/static/favicon.ico
Alias /media/ /var/www/html/test_app/media/
Alias /static/ /var/www/html/test_app/static/
<Directory /var/www/html/test_app/static>
Require all granted
</Directory>
<Directory /var/www/html/test_app/media>
Require all granted
</Directory>
=============================
excerpt from settings.py in test_app
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "XXX.XXX.107.165"]
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'mod_wsgi.server',
]
Regards,
Bob