[英]wsgi cant find modules in virtualenv in weblate + apache2 + wsgi setup
我讓 weblate 在開發模式下運行:8000。 但是我無法在虛擬環境中使用 wsgi 在 apache2 中運行它,一切正常。
基於 apache 錯誤,它甚至找不到安裝的 django。 我這樣做了,但看到了另一個缺少模塊的錯誤。 很明顯,wsgi 不尊重/搜索 virtualenv 中 python 的模塊。
我的服務器是 Ubuntu 19.04。
請建議。
<VirtualHost *:80>
ServerName xxyyzz.com
# DATA_DIR/static/favicon.ico
Alias /favicon.ico xxyyzz/weblate-env/lib/python3.7/site-packages/data/static/favicon.ico
# DATA_DIR/static/
Alias /static/ xxyyzz/weblate-env/lib/python3.7/site-packages/data/static/
<Directory xxyyzz/weblate-env/lib/python3.7/site-packages/data/static/>
Require all granted
</Directory>
# DATA_DIR/media/
Alias /media/ xxyyzz/weblate-env/lib/python3.7/site-packages/data/media/
<Directory /home/weblate/data/media/>
Require all granted
</Directory>
# Path to your Weblate virtualenv
WSGIDaemonProcess weblate python-path=xxyyzz/weblate-env
WSGIProcessGroup weblate
WSGIApplicationGroup weblate
WSGIScriptAlias / xxyyzz/weblate-env/lib/python3.7/site-packages/weblate/wsgi.py process-group=weblate
WSGIPassAuthorization On
<Directory xxyyzz/weblate-env/lib/python3.7/site-packages/weblate/>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
事實證明,示例配置是錯誤的,它應該使用python-path
而不是python-home
用於WSGIDaemonProcess
。 我剛剛在 Weblate 中修復了這個問題,您可能也需要在配置中進行此類更改。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.