Ошибка в логах апача выглядит так:
[Mon Jan 09 15:28:54.916884 2023] [wsgi:error] [pid 28704:tid 140712167257856] [remote 5.16.96.73:49183] mod_wsgi (pid=28704): Target WSGI script '/home/www/xtaz.shop/main/wsgi.py' cannot be loaded as Python module.
[Mon Jan 09 15:28:54.916970 2023] [wsgi:error] [pid 28704:tid 140712167257856] [remote 5.16.96.73:49183] mod_wsgi (pid=28704): Exception occurred processing WSGI script '/home/www/xtaz.shop/main/wsgi.py'.
[Mon Jan 09 15:28:54.917063 2023] [wsgi:error] [pid 28704:tid 140712167257856] [remote 5.16.96.73:49183] Traceback (most recent call last):
[Mon Jan 09 15:28:54.917090 2023] [wsgi:error] [pid 28704:tid 140712167257856] [remote 5.16.96.73:49183] File "/home/www/xtaz.shop/main/wsgi.py", line 18, in <module>
[Mon Jan 09 15:28:54.917096 2023] [wsgi:error] [pid 28704:tid 140712167257856] [remote 5.16.96.73:49183] from django.core.wsgi import get_wsgi_application
[Mon Jan 09 15:28:54.917114 2023] [wsgi:error] [pid 28704:tid 140712167257856] [remote 5.16.96.73:49183] ModuleNotFoundError: No module named 'django'
[Mon Jan 09 15:28:55.047832 2023] [wsgi:error] [pid 28704:tid 140712058062592] [remote 5.16.96.73:49189] mod_wsgi (pid=28704): Target WSGI script '/home/www/xtaz.shop/main/wsgi.py' cannot be loaded as Python module.
[Mon Jan 09 15:28:55.047915 2023] [wsgi:error] [pid 28704:tid 140712058062592] [remote 5.16.96.73:49189] mod_wsgi (pid=28704): Exception occurred processing WSGI script '/home/www/xtaz.shop/main/wsgi.py'.
[Mon Jan 09 15:28:55.048173 2023] [wsgi:error] [pid 28704:tid 140712058062592] [remote 5.16.96.73:49189] Traceback (most recent call last):
[Mon Jan 09 15:28:55.048213 2023] [wsgi:error] [pid 28704:tid 140712058062592] [remote 5.16.96.73:49189] File "/home/www/xtaz.shop/main/wsgi.py", line 18, in <module>
[Mon Jan 09 15:28:55.048221 2023] [wsgi:error] [pid 28704:tid 140712058062592] [remote 5.16.96.73:49189] from django.core.wsgi import get_wsgi_application
[Mon Jan 09 15:28:55.048275 2023] [wsgi:error] [pid 28704:tid 140712058062592] [remote 5.16.96.73:49189] ModuleNotFoundError: No module named 'django'
Мой .conf:
<VirtualHost *:80>
ServerName xtaz.shop
ServerAlias www.xtaz.shop
ServerAdmin postmaster@xtaz.shop
DocumentRoot /home/www/xtaz.shop
<Directory /home/www/xtaz.shop/main/wsgi.py>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
Require all granted
</Directory>
WSGIDaemonProcess xtaz.shop python-home=/home/www/xtaz.shop/venv python-path=/home/www/xtaz.shop
WSGIProcessGroup xtaz.shop
WSGIScriptAlias / /home/www/xtaz.shop/main/wsgi.py
ErrorLog /home/www/xtaz.shop/error.log
CustomLog /home/www/xtaz.shop/custom.log combined
</VirtualHost>
wsgi.py:
import os
import sys
from django.core.wsgi import get_wsgi_application
sys.path.append('/home/www/xtaz.shop/')
sys.path.append('/home/www/xtaz.shop/main/')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings")
application = get_wsgi_application()
Находясь в venv и прописывая pip freeze, django имеется, также при попытке запустит вручную через
python manage.py runserver 0:8000
все работает.
Подскажите, пожалуйста в чем может быть проблема?