正确安装 mod_wsgi 后 pip
,并将其配置相关的东西插入 http.conf (apache) . wsgi_module已成功加载,如下面的日志所示:
[Mon Dec 10 10:39:39.048697 2018] [wsgi:info] [pid 16708:tid 692] mod_wsgi(pid = 16708):Python home c:/ users /.../ appdata / local / programs / python / python37 . [Mon Dec 10 10:39:39.048697 2018] [wsgi:info] [pid 16708:tid 692] mod_wsgi(pid = 16708):初始化Python . [Mon Dec 10 10:39:39.081683 2018] [wsgi:info] [pid 16708:tid 692] mod_wsgi(pid = 16708):附加翻译'' . [Mon Dec 10 10:39:39.084682 2018] [wsgi:info] [pid 16708:tid 692] mod_wsgi(pid = 16708):将“E:/ projects / python / ...”添加到路径中 . [Mon Dec 10 10:39:39.089662 2018] [wsgi:info] [pid 16708:tid 692] mod_wsgi(pid = 16708):导入'mod_wsgi' .
但是在apache模块中,wsgi_module说没有模块文件,如下图所示:
当我点击wsgi_module时,会显示以下输出:
httpd.conf文件中有'LoadModule wsgi_module modules / mod_wsgi.so'行,但apachex.y.z / modules /目录中没有'mod_wsgi.so'文件 .
这是我的http.conf行与mod_wsgi相关联:
LoadFile "c:/users/.../appdata/local/programs/python/python37/python37.dll"
LoadModule wsgi_module "c:/users/.../appdata/local/programs/python/python37/lib/site-packages/mod_wsgi/server/mod_wsgi.cp37-win_amd64.pyd"
WSGIPythonHome "c:/users/.../appdata/local/programs/python/python37"
WSGIPythonPath "E:/projects/python/..."
WSGIScriptAlias /scripts "E:/projects/python/.../.../wsgi.py"
DocumentRoot "E:\\projects\\python\\...\\...\\..."
<Directory "E:\\projects\\python\\...\\...\\...">
<Files wsgi.py>
Allow From all
</Files>
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options +Indexes +FollowSymLinks +Multiviews +ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all
Allow From all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Require local
</Directory>