如何修复在Apache中运行mod_wsgi时出现的“invalid command 'WSGIScriptAlias'"错误

q5lcpyga  于 2023-01-21  发布在  Apache
关注(0)|答案(1)|浏览(202)

我尝试在Windows上使用Apache和Mod_wsgi来运行Django项目。我将Apache作为服务安装,并将mod_wsgi安装到Python中,然后将其复制到Apache模块中。我添加了mod_wsgi文档中提到的配置细节,但当我尝试运行Apache时,它触发了:
“Mod_Wsgi错误:无效无效命令'WSGIScriptAlias',可能拼写错误或由服务器配置中未包含的模块定义....
mod_wsgi downloaded to Apache modules
Apache的httpd.conf文件:

Define SRVROOT "C:\Users\(me)\Desktop\httpd-2.4.51-win64- 
VS16\Apache24"

ServerRoot "C:\Users\(me)\Desktop\httpd-2.4.51-win64 
VS16\Apache24"

WSGIScriptAlias /C:/Users/(me)/Desktop/coding_stuff/django_webpage_project/django_webpage_project/wsg 
 i.py

WSGIPythonHome C:/Users/(me)/Desktop/coding_stuff/env/venv_1
WSGIPythonPath C:/Users/(me)/Desktop/coding_stuff/django_webpage_project

<Directory/C:/Users/(me)/Desktop/coding_stuff/django_webpage_project/django_webpage_project>
 <Files wsgi.py>
 Require all granted
 </Files>
 </Directory>
xmq68pz9

xmq68pz91#

问题是我下载的Mod_wsgi文件缺少Apache运行Mod_wsgi所需的“modules.so”共享对象文件。仍然不知道从哪里获取此文件,但这肯定是问题所在。

相关问题