![Django mod_wsgi Apache 오류 403 Ubuntu 22.04에서는 금지됨](https://rvso.com/image/1072180/Django%20mod_wsgi%20Apache%20%EC%98%A4%EB%A5%98%20403%20Ubuntu%2022.04%EC%97%90%EC%84%9C%EB%8A%94%20%EA%B8%88%EC%A7%80%EB%90%A8.png)
Apache 애플리케이션의 Django mod_wsgi는 아래에 언급된 구성을 사용하여 Ubuntu 20.04 및 이전 버전에서 잘 작동하지만 Ubuntu 22.04에서 동일한 구성을 수행하면 403 Forbidden 오류가 발생합니다. 및 오류 로그에 권한 거부됨: mod_wsgi가 있습니다.
모든 파일에 대한 권한을 변경해 보았는데 작동하지 않습니다.
아파치 구성:
<VirtualHost *:80>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /home/ubuntu/mydjango/mydjango>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
alias /static /home/ubuntu/mydjango/static
<Directory /home/ubuntu/mydjango/static>
Require all granted
</Directory>
WSGIDaemonProcess myapp python-home=/home/ubuntu/mydjango/venv python-path=/home/ubuntu/mydjango
WSGIProcessGroup myapp
WSGIScriptAlias / /home/ubuntu/mydjango/mydjango/wsgi.py
</VirtualHost>
아파치 오류 로그:
Current thread 0x00007fb606719780 (most recent call first):
<no Python frame>
[Sun Jun 05 05:59:07.594727 2022] [wsgi:warn] [pid 37044:tid 140419768883072] (13)Permission denied: mod_wsgi (pid=37044): Unable to stat Python home /home/ubuntu/mydjango/venv. Python interpreter may not be able to be initialized correctly. Verify the supplied path and access permissions for whole of the path.
Python path configuration:
PYTHONHOME = '/home/ubuntu/mydjango/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/ubuntu/mydjango/venv'
sys.base_exec_prefix = '/home/ubuntu/mydjango/venv'
sys.platlibdir = 'lib'
sys.executable = '/usr/bin/python3'
sys.prefix = '/home/ubuntu/mydjango/venv'
sys.exec_prefix = '/home/ubuntu/mydjango/venv'
sys.path = [
'/home/ubuntu/mydjango/venv/lib/python310.zip',
'/home/ubuntu/mydjango/venv/lib/python3.10',
'/home/ubuntu/mydjango/venv/lib/python3.10/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'