Reputation: 1412
I want to run django site with apache mod_wsgi , but as per django documentation whenever i write following in httpd.conf file :
WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py
WSGIPythonPath /path/to/mysite.com
<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
Apache server fails to start , Issue was that mod_wsgi module was not present in apache24 modules directory and due to it following line was causing issue
LoadModule wsgi_module modules/mod_wsgi.so
I am trying to get this mod_wsgi.so file but i could find it anywhere . I downloaded mod_wsgi-4.4.12.tar.gz from below url but there also i cant get mod_wsgi.so file .
https://github.com/GrahamDumpleton/mod_wsgi
I tried getting it from http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi but here files are with extension .whl
at one link its written that we can build our own mod_wsgi.so with help of nmake command nmake -f apXYpyXY-winNN-VC?.mk but in windows i get error nmake is not recogiznised as a command .
Please suggest . I am using Windows 7 , Python 2.7 , 64 bit , Apache 2.4 64 bit and Apache 2.2 32 bit .
Upvotes: 2
Views: 16284
Reputation: 165
It is an old question. But to help anyone facing the same issue, the .so files can be found here: (I spent hours finding it) https://github.com/GrahamDumpleton/mod_wsgi/releases
Be sure to read the note provided by the developer to know which version is the one you need. https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/win32/README.rst
Add: remember to change the version you downloaded to mod_wsgi.so before load it into \wamp\bin\apache[apache2.4.9]\modules
Upvotes: 0
Reputation: 3322
Try,
LoadModule wsgi_module modules/mod_wsgi.so
DirectoryIndex index.py default.py wsgi.py
WSGIPythonPath "{$path}\python\Lib;{$path}\python\Lib\site-packages;{$path}\python\DLLs"
WSGIPythonHome "{$path}\python"
WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py
<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
Let {$path}
be the directory where Python Folder is installed/located. Notice the change in WSGIPythonPath and WSGIPythonHome.
You can search for pre-compiled binaries from here: https://github.com/GrahamDumpleton/mod_wsgi/tree/master/win32#using-the-pre-compiled-binaries
Also mowd_wsgi's Quick Configuration Guide is helpful.
Upvotes: 2