mod_wsgi on Apache and Windows 7

£可爱£侵袭症+ 提交于 2019-12-11 18:08:18

问题


I installed Apache and mod_wsgi on Win 7 and copied config text output of mod_wsgi into httpd.conf.

I also check and see server working before mod_wsgi.

Now when I try to connect on local host I get a connection refused. After some research I found out I should add mod_wsgi.server to my app settings. I did it and ran runmodwsgi which failed because it was running a script in Windows which used os.getuid. Not valid in Windows. Is it mandatory to add mod_wsgi to isntalled apps in django project? Not mentioned in here.

If so what can I do for os.getuid in Windows?

Beside these why I get connection refused and no log if only my handler config is incorrect.


回答1:


I ran httpd from cmd and found the error:

[Fri Dec 21 10:11:17.538864 2018] [wsgi:info] [pid 64084:tid 180] mod_wsgi (pid=64084): Initializing Python. Fatal Python error: Py_Initialize: unable to load the file system codec ModuleNotFoundError: No module named 'encodings'

Don't know the reason yet.

[UPDATE] Changed PYTHONHOME to python base path and it is working now. There most be an in compatibility between venv and setuptools.



来源:https://stackoverflow.com/questions/53848365/mod-wsgi-on-apache-and-windows-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!