开发者

mod_wsgi not found for apache/windows

My apache can't locate mod_wsgi on windows. I'm using apache 2.2 and the server starts correctly with the default httpd.conf.

I placed mod_wsgi.so into apache's modules directory (C:\Program Files\Apache Software Foundation\Apache2.2\modules) with read/execute permission for all users. I added the following line to the default httpd.conf

LoadModule wsgi_module modules/mod_wsgi.so

And i get this error when trying to start apache. Anyone have any ideas/suggestions?

httpd.exe: Syntax error on line 129 of C:/Program Files/Apache Software Foundation/Apache2.2/c开发者_JS百科onf/httpd.conf: Cannot load C:/Program Files/Apache Software Foundation/Apache2.2/modules/mod_wsgi.so into server: The specified module could not be found.

[Tue Nov 23 17:41:55 2010] [warn] (OS 995)The I/O operation has been aborted because of either a thread exit or an application request. : winnt_accept: Asynchronous AcceptEx failed.

[Tue Nov 23 17:41:56 2010] [notice] Child 7384: Released the start mutex


What is the exact name of the mod_wsgi module file that you stuck in modules directory. Did you rename it from what was downloaded? Did you ensure you didn't stick an extra .so in the name so as to get mod_wsgi.so.so? Windows may be hiding one of the extensions if you did do that.


Another possibility is that Apache 2.2 is installed as 32-bit while Python was installed as 64-bit on a 64-bit machine. I had a situation where anything python mod_wsgi and legacy mod_python apps were erroring. If you are running 32-bit Apache it only likes to find 32-bit Python no matter the version.


See this page for a simple solution. Your apache is most likely a 32bit installed on a 64-bit windows, or otherwise. Or you have a filename mistake. To verify the filename is correct and exists with the extension mentioned: Click the "Tools" menu in any explorer window, Click "Folder Options" then in the "View" tab, uncheck "Hide extensions for known file types" and click [Apply] or [OK]. Then you can proceed after your verification of mod_wsgi.so


try with

LoadFile "c:/yourPythonPath/python**.dll"

** => version of your python

on apache.config


Envirnoment python3.8.0 Apache2.4.41 mod_wsgi4.7.1 I have install the mod_wsgi in my global python envirnoment, The are some information from output to the command line(my python home is E:\Program Files\python3.8):

Extracting mod_wsgi-4.7.1-py3.8-win-amd64.egg to e:\program files\python3.8\lib\site-packages Adding mod-wsgi 4.7.1 to easy-install.pth file Installing mod_wsgi-express-script.py script to E:\Program Files\Python3.8\Scripts Installing mod_wsgi-express.exe script to E:\Program Files\Python3.8\Scripts

so there is a executable file mod_wsgi-express.exe in the directory E:\Program Files\Python3.8\Scripts and you can run the following command in your command line

mod_wsgi-express module-config

my output is:

LoadFile "E:/Program Files/Python3.8/python3.8.dll" LoadModule wsgi_module "E:/Program Files/Python3.8/lib/site-packages/mod_wsgi-4.7.1-py3.8-win-amd64.egg/mod_wsgi/server/mod_wsgi.cp38-win_amd64.pyd" WSGIPythonHome "E:/Program Files/Python3.8"

copy the output to you httpd.conf out produre is reference from https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/win32/README.rst this is my first time answer question and my monther language isn't English, I hope I can help you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜