mod_wsgi not working on Apache 2.4.12 64 bit on Windows 7

10,744

I think I found the solution. I was confused about which file to download in the site that has windows binaries for mod_wsgi.so. This is how the file name is structured (this is what I wasn't understanding):

mod_wsgi[WSGI version]+ap[Apache version]vc[Visual C++ Redistributable version that was used to compile Apache]‑cp[Python version]‑none‑win[32/64 bit version].whl

Some people are having compatibility issues because it's needed to match the exact Apache version, compiled with the exact Visual C++ Redistributable version, having installed the exact Python version specified, all of these in 32 bit or 64 bit version according to the file you donwloaded. If some of these things don't match, you'll experience the error I was having. The solution is to download the appropriate file, depending on what you have installed, or to install what is available to work with these windows binaries. In my case, I was trying to work with Python 2.7 64 bit, unfortunately there is no mod_wsgi binary for this version. So here is what I had installed:

  • Python 2.7.9 32 bit
  • Apache Haus 2.4.12 32 bit VC9
  • mod_wsgi‑4.4.11+ap24vc9‑cp27‑none‑win32.whl

Then I just unziped the .whl file, put it on modules folder and added a LoadModule directive for it in httpd.conf. It's a pity I have to work with 32 bit architecture, but at least now everything seems to be working just fine and wsgi_module appears on httpd -M list of loaded modules. I hope this answer helps someone in need!

Share:
10,744

Related videos on Youtube

renatov
Author by

renatov

Languages: Python, C, Prolog, PHP, MySQL, HTML, CSS, Javascript.

Updated on September 18, 2022

Comments

  • renatov
    renatov over 1 year

    I'm running Apache (Haus) 2.4.12 64 bit on Windows 7 64 bit. Python 2.7.9 64 bit is installed. Apache is running flawless if I don't try to load mod_wsgi. I downloaded mod_wsgi.so from this site. I extracted this file, copied mod_wsgi.so to C:\Apache24\modules and added this line to httpd.conf:

    LoadModule wsgi_module modules/mod_wsgi.so
    

    After that, Apache doesn't work anymore:

    C:\Apache24\bin>httpd.exe -k start
    httpd.exe: Syntax error on line 76 of C:/Apache24/conf/httpd.conf: Cannot load 
    modules/mod_wsgi.so into server: The specified module could not be found.
    

    It says it could not find mod_wsgi.so, but I checked many times, it's there! I tryed the same procedure with each four available 64 bit versions in the site, but all of them give the same error. I don't know what's happening. I already tryed Apache Haus 2.4.12 compiled with VC9, VC11 and Apache Lounge 2.4.12 compiled with VC10 too. Could someone please help me?


    PS: this question and this question don't solved my problem. Everything is already 64 bit, I'm loading the module correctly and Python is installed for all users.

  • Graham Dumpleton
    Graham Dumpleton about 9 years
    The official documentation which explains properly the various dependency requirements and references to official binary builds for Windows can be found at github.com/GrahamDumpleton/mod_wsgi/blob/develop/win32/…