Развернутое приложение django на apache 2 (403 Forbidden)
У меня проблемы с развертыванием моего приложения django на сервере linux под управлением apache2.
У меня уже есть несколько приложений, работающих на этом сервере без проблем. Я выполнил те же шаги, что и обычно, но по какой-то причине каждый раз, когда я перехожу по url нового приложения, меня встречает ошибка 403 Forbidden.
Проверили журнал apache и получили следующее
Current thread 0x00007f11d99fcc40 (most recent call first):
<no Python frame>
[Mon Apr 07 13:34:27.128681 2025] [wsgi:warn] [pid 2703370:tid 139714642299968] (13)Permission denied: mod_wsgi (pid=2703370): Unable to stat Python home /home/tinytoes/surveyV2/venv. Python interpreter may not be able to be initialized>Python path configuration:
PYTHONHOME = '/home/tinytoes/surveyV2/venv'
PYTHONPATH = (not set)
program name = 'python3'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/usr/bin/python3'
sys.base_prefix = '/home/tinytoes/surveyV2/venv'
sys.base_exec_prefix = '/home/tinytoes/surveyV2/venv'
sys.executable = '/usr/bin/python3'
sys.prefix = '/home/tinytoes/surveyV2/venv'
sys.exec_prefix = '/home/tinytoes/surveyV2/venv'
sys.path = [
'/home/tinytoes/surveyV2/venv/lib/python38.zip',
'/home/tinytoes/surveyV2/venv/lib/python3.8',
'/home/tinytoes/surveyV2/venv/lib/python3.8/lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Я не совсем уверен, что ошибка имеет отношение к делу.
Вот разрешения, которые я установил для приложения
drwxr-xr-x 8 tinytoes www-data 4096 Apr 7 13:33 surveyV2
и вот мой Vhost
<VirtualHost *:84>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
Alias /static /home/tinytoes/surveyV2/static
<Directory /home/tinytoes/surveyV2/static>
Require all granted
</Directory>
<Directory /home/tinytoes/surveyV2/surveyV2>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIScriptAlias / /home/tinytoes/surveyV2/surveyV2/wsgi.py
WSGIDaemonProcess surveyV2 python-path=/home/tinytoes/surveyV2 python-home=/home/tinytoes/surveyV2/venv
WSGIProcessGroup surveyV2
</VirtualHost>
Любая помощь будет оценена по достоинству