Cannot run mod_wsgi on Apache 2.4 x64 Windows

896 views
Skip to first unread message

Shrike

unread,
Oct 30, 2014, 7:01:39 AM10/30/14
to mod...@googlegroups.com

I have a Apache 2.2 installation with a site on Django. I load mod_wsgi.so module in my Apache config. Now I'm trying to migrate onto Apache 2.4 and have difficulties with mod_wsgi.

First of all: my server is on Windows 2008R2 (x64).

I setup Apache 2.4 x64 (httpd-2.4.10-win64-VC11.zip from Apache Lounge).

Then I downloaded mod_wsgi binary from http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi - I took mod_wsgi‑3.5.ap24.win‑amd64‑py2.6.zip as my Apache is x64 and my Python is 2.6.

In conf/httpd.conf I have

LoadModule mod_wsgi modules/mod_wsgi.so
 

I'm getting error when run httpd.exe:

httpd.exe: Syntax error on line 179 of C:/Prog/Apache24/conf/httpd.conf: Cannot load modules/mod_wsgi.so into server : The specified module could not be found.

If I replace mod_wsgi.so with x86 version then I'll get other error about incorrect bitness, so the module seems to try be loaded. I have all vsredist (2008/9,20010/10,2012/11) installed.

What's wrong?

Graham Dumpleton

unread,
Oct 30, 2014, 7:08:53 AM10/30/14
to mod...@googlegroups.com
On 30/10/2014, at 10:01 PM, Shrike <ser...@dorogin.com> wrote:

I have a Apache 2.2 installation with a site on Django. I load mod_wsgi.so module in my Apache config. Now I'm trying to migrate onto Apache 2.4 and have difficulties with mod_wsgi.

First of all: my server is on Windows 2008R2 (x64).

I setup Apache 2.4 x64 (httpd-2.4.10-win64-VC11.zip from Apache Lounge).

Then I downloaded mod_wsgi binary from http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi - I took mod_wsgi‑3.5.ap24.win‑amd64‑py2.6.zip as my Apache is x64 and my Python is 2.6.

Did you unzip the .zip file?

What was the name of the .so file that was in it?

What is the full path of the directory you put the .so file in?

Sergei Dorogin

unread,
Oct 30, 2014, 7:36:17 AM10/30/14
to mod...@googlegroups.com

Then I downloaded mod_wsgi binary from http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi - I took mod_wsgi‑3.5.ap24.win‑amd64‑py2.6.zip as my Apache is x64 and my Python is 2.6.

Did you unzip the .zip file?
Sure :)
I put mod_wsgi.so file into the modules folder: C:\Prog\Apache24\modules\mod_wsgi.so

What was the name of the .so file that was in it?
mod_wsgi.so
 
What is the full path of the directory you put the .so file in?
I put mod_wsgi.so into C:\Prog\Apache24\modules\
And I load mod_wsgi in the same way as others:

LoadModule ssl_module modules/mod_ssl.so
LoadModule mod_wsgi modules/mod_wsgi.so



четверг, 30 октября 2014 г., 14:08:53 UTC+3 пользователь Graham Dumpleton написал:
четверг, 30 октября 2014 г., 14:08:53 UTC+3 пользователь Graham Dumpleton написал:

Graham Dumpleton

unread,
Oct 30, 2014, 7:43:31 AM10/30/14
to mod...@googlegroups.com
Was the Python 2.6 installation installed for all users or just the user that installed it?

If not installed for all users it will not be able to be found by the user that Apache runs as.

Graham

--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To post to this group, send email to mod...@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Sergei Dorogin

unread,
Oct 30, 2014, 7:52:09 AM10/30/14
to mod...@googlegroups.com
Was the Python 2.6 installation installed for all users or just the user that installed it?
How to check it?
 
If not installed for all users it will not be able to be found by the user that Apache runs as.
Anyway, I run Apache httpd.exe from command line under a user and that user does have access to Python:
C:\Prog\Apache24\bin>httpd.exe            
httpd
.exe: Syntax error on line 179 of C:/Prog/Apache24/conf/httpd.conf: Cannot load modules/mod_wsgi.so into server
: The specified module could not be found.
                                                                       
C
:\Prog\Apache24\conf>python --version
Python 2.6.5



четверг, 30 октября 2014 г., 14:43:31 UTC+3 пользователь Graham Dumpleton написал:

Sergei Dorogin

unread,
Oct 30, 2014, 9:52:19 AM10/30/14
to mod...@googlegroups.com
Probably the problem is in Python - it's x86.

So I trying to switch to x86 version of all:
- Apache httpd-2.4.10-win32-VC11.zip
- mod_wsgi-3.5.ap24.win32-py2.6.zip
- the same Python 2.6

Now running httpd.exe says:
httpd.exe: Syntax error on line 179 of C:/Prog/Apache24/conf/httpd.conf: Can't locate API module structure `mod_wsgi
' in file C:/Prog/Apache24/modules/mod_wsgi.so: No error

Sergei Dorogin

unread,
Oct 30, 2014, 9:54:57 AM10/30/14
to mod...@googlegroups.com
Oh, found answer:  http://serverfault.com/questions/435926/cant-locate-api-module-structure-mod-wsgi

LoadModule mod_wsgi modules/mod_wsgi.so

is wrong. It should have been:

LoadModule wsgi_module modules/mod_wsgi.so


четверг, 30 октября 2014 г., 16:52:19 UTC+3 пользователь Sergei Dorogin написал:
Reply all
Reply to author
Forward
0 new messages