【发布时间】:2020-11-19 07:49:56
【问题描述】:
我正在尝试在VirtualHost 中添加WSGIPythonPath,但它给我一个错误:
/etc/httpd/conf/httpd.conf 第 549 行的语法错误:
WSGIPythonPath 不能出现在节内
我尝试通过以下方式解决它: Where should WSGIPythonPath point in my virtualenv?
但是,经过深入研究,我发现WSGIDaemonProcess 和WSGIProcessGroup 在Windows 上不受Why WSGIDaemonProcess isn't available on Windows? 支持。
那么,我应该如何添加WSGIPythonPath 以及在哪里可以在我的 Apache24 服务器上托管多个 Django 站点。
任何帮助都是有益的。
这是我的httpd.conf 文件:
LoadFile "c:/python37/python37.dll"
LoadModule wsgi_module "c:/python37/lib/site-packages/mod_wsgi/server/mod_wsgi.cp37-win_amd64.pyd"
WSGIPythonHome "c:/python37"
WSGIPythonPath "E:/edukon/"
Listen 7020
<VirtualHost *:7020>
ServerName 000.000.000.000
# Django Project
WSGIScriptAlias / "E:/edukon/edukon/wsgi.py"
<Directory "E:/edukon/edukon">
<Files wsgi.py>
Require all granted
</Files>
</Directory>
Alias /static "E:/edukon/static/"
<Directory "E:/edukon/static/">
Require all granted
</Directory>
Alias /media "E:/edukon/media/"
<Directory "E:/edukon/media/">
Require all granted
</Directory>
</VirtualHost>
【问题讨论】: