Following tutorial after tutorial and trying a million different configurations, I still am unable to get my flask app to run under mod_wsgi:
My WSGI Script
#!/usr/bin/python
import sys
import logging
import site
logging.basicConfig(stream=sys.stderr)
site.addsitedir('/server/FLASKENV/lib/python3.9/site-packages/')
sys.path.insert(0,"/server/FLASKAPPS/PPSPortal/restapi/")
from main.py import app as application
application.secret_key="REDACTED"
Apache 2 Config:
VirtualHost *:80>
ServerName myserver.com
ServerAdmin me@myserver.com
WSGIScriptAlias / /server/FLASKWSGI/ppsportal.wsgi
WSGIDaemonProcess ppsrestapi user=www-data group=www-data threads=5 python-home=/server/FLASKENV
<Directory /server/FLASKAPPS/PPSPortal/restapi>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
ErrorLog /server/FLASKAPPS/PPSPortal/restapi/logs/error.log
LogLevel warn
CustomLog /server/FLASKAPPS/PPSPortal/restapi/logs/access.log combined
</VirtualHost>
The entire directory for which these apps exists are owned my www-data:www-data and the error I get is 403 Forbidden.
What I am getting in the error.log:
[Sat Aug 14 09:22:57.441200 2021] [authz_core:error] [pid 24121:tid 140166979081984] [client 192.168.0.15:41200] AH01630: client denied by server configuration: /server/FLASKWSGI/ppsportal.wsgi