I was using django with Apache2 when I encountered an error in the localhost server. Apache would throw a 500 Internal Server Error, with no logs or terminal feedback. I have mod_wsgi installed with official Apache2. My apache2.conf looks like this:
WSGIPythonHome "/usr" WSGIPythonPath var/www/mysite <VirtualHost *:80> WSGIScriptAlias / /var/www/mysite/mysite/wsgi.py LoadModule wsgi_module "/home/server/.local/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-x86_64-linux-gnu.so" <Directory /var/www/mysite/mysite> <Files wsgi.py> Require all granted </Files> </Directory> WSGIDaemonProcess 127.0.1.1 python-path=/var/www/mysite python-home=/usr WSGIProcessGroup 127.0.1.1 Alias /file.zip /var/www/mysite/static/file.zip Alias /static/ /var/www/mysite/static/ <Directory /var/www/mysite/static> Require all granted </Directory> </VirtualHost>
I do have some logs from way back when I just started out with apache. They told me that it failed to import django from wsgi.py, but i do not think these will be that helpful becuase they were generated such a long time ago. I am leaving it in, just in case.
I have tried for two days of looking on multiple Stack Exchange sites, and have not found a reasonable explanation. I use sudo apachectl start to start my server. Could someone help me find why this is happening and how to prevent it?
I deleted the old error logs and ran the program again. The error log shows that it could not import django from wsgi.py, which was the same in the previous error logs that were created when I started out.