Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem of loading mod_wsgi module into apache on Windows 64-bit

I'm trying to install mod_wsgi module followed this instruction. I've downloaded mod_wsgi.so from this source. It seems like apache cannot restart services properly and the page cannot be loaded after I added the following line to httpd.conf

LoadModule wsgi_module modules/mod_wsgi.so

I've checked some issues from some sources as follows:

  1. The file name is correct - mod_wsgi.so not mod_wsgi.so.so
  2. Permissions on the file was set as same as other modules that loaded properly
  3. Python installed for all users

Environment:

  • Windows Server® Standard FE 64-bit
  • Apache 2.2.8 on WAMP 2.0
  • Python 2.7.1 installed for all users

Without loading this module, apache runs properly. What is my problem?

Application error.log:

[Mon May 23 10:12:20 2011] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Mon May 23 10:12:20 2011] [notice] Child 4528: Exit event signaled. Child process is ending.
[Mon May 23 10:12:21 2011] [notice] Child 4528: Released the start mutex
[Mon May 23 10:12:22 2011] [notice] Child 4528: All worker threads have exited.
[Mon May 23 10:12:27 2011] [notice] Child 4528: Child process is exiting
[Mon May 23 10:12:28 2011] [notice] Parent: Child process exited successfully.
[Mon May 23 10:13:46 2011] [notice] Apache/2.2.8 (Win32) PHP/5.2.6 configured -- resuming normal operations
[Mon May 23 10:13:46 2011] [notice] Server built: Jan 18 2008 00:37:19
[Mon May 23 10:13:46 2011] [notice] Parent: Created child process 5316
[Mon May 23 10:13:46 2011] [notice] Child 5316: Child process is running
[Mon May 23 10:13:46 2011] [notice] Child 5316: Acquired the start mutex.
[Mon May 23 10:13:46 2011] [notice] Child 5316: Starting 64 worker threads.
[Mon May 23 10:13:46 2011] [notice] Child 5316: Starting thread to listen on port 81.
[Mon May 23 10:14:57 2011] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Mon May 23 10:14:57 2011] [notice] Child 5316: Exit event signaled. Child process is ending.
[Mon May 23 10:14:58 2011] [notice] Child 5316: Released the start mutex
[Mon May 23 10:14:59 2011] [notice] Child 5316: All worker threads have exited.
[Mon May 23 10:15:04 2011] [notice] Child 5316: Child process is exiting
[Mon May 23 10:15:04 2011] [notice] Parent: Child process exited successfully.

From apache error.log, is it clear that installed apache is 32-bit?

Soulution: Change everything to 64-bit.

like image 267
Protocole Avatar asked May 23 '11 06:05

Protocole


3 Answers

I was faced with this situation as well, and Apache would run on windows 64bit, but won't if mod_wsgi is loaded.

I found a solution which is pretty simple:

  1. Download and install a 64-bit version of Apache which is easily handled if you download and install from http://wampserver.com/
  2. Download mod_wsgi from this page
  3. Extract the content of the downloaded zipped file into c:\wamp\bin\apache\Apache2.2.21\modules\ and
  4. Edit httpd.conf and add a line like: LoadModule wsgi_module modules/mod_wsgi.so
  5. Restart apache and you can then continue your django development.

Summary: Everything (both apache and mod_wsgi) has to be 64bit for you to be able to run Apache/mod_wsgi on a 64-bit windows.

like image 138
Peter Avatar answered Oct 24 '22 09:10

Peter


From what I understand...

Currently no official 64bit versions of Apache and PHP exists for Microsoft Windows.

However, there is a dude out there who, at the time of writing this, has at least compiled Apache 2.2.19 x64 for us, which you can download here.

If you want a newer version, you'd have to compile it yourself, but that would be quite the undertaking!

Furthermore, even if you do get Apache x64 running nicely on Windows, what do you intend to do about mod_wsgi? This is the very reason I decided to just create an Arch Linux LAMP stack for this very purpose. I have it working fine now, but since Aptana doesn't sync with Django projects I'm looking into the Windows solutions again.

Please, let me know if you find a good solution!

EDIT: I found these 64-bit mod_wsgi's for py2.6 and 2.7, but I have yet to get them working.

EDIT: Yes! I got it working! My Apache Service Monitor has a green light and now says Apache/2.2.19 (Win64) mod_wsgi/3.3 Python/2.6.4. I'm using 2.6.4 because that's what Autodesk Maya is running and I want to keep the same version for consistency.

like image 43
jedmao Avatar answered Oct 24 '22 11:10

jedmao


I got Apache/Mod_wsgi running on a Windows 2008 server.

The link to the 64 bit version of Apache provided by Peter is broken. I found one that worked for me at:

http://www.apachelounge.com/download/win64/

Read the readme.txt. The install is very simple.

His link to the 64 bit mod_wsgi is still good:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi

I used an win-amd64 version just fine and I think the hardware I'm on is Intel.

I made sure the Apache and Mod_wsgi versions matched as did the python version. I believe the mod_wsgi version I used was 3.3.

like image 20
Jim Paul Avatar answered Oct 24 '22 10:10

Jim Paul