Skip to content

Instantly share code, notes, and snippets.

@serafdev
Created July 5, 2019 15:55
Show Gist options
  • Save serafdev/016104eb81a3cc981bf7c955975c6329 to your computer and use it in GitHub Desktop.
Save serafdev/016104eb81a3cc981bf7c955975c6329 to your computer and use it in GitHub Desktop.
mod_wsgi LoadModule on Apache for Windows

(Not detailed) Installation

First install mod_wsgi from pip, or a precompiled one from https://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi Note: cp37 means python 3.7, cp27 means python 2.7, etc, so pick the right one for your platform

Find the installation path of your module with this command:

mod_wsgi-express module-location
> c:\code\jotaro\venv\lib\site-packages\mod_wsgi\server\mod_wsgi.cp37-win_amd64.pyd

httpd.conf LoadModule

Now add this line with the path you just found to the C:\Apache24\bin\httpd.conf configuration file

# Example:
LoadModule wsgi_module c:\code\jotaro\venv\lib\site-packages\mod_wsgi\server\mod_wsgi.cp37-win_amd64.pyd

Now you can test if the module is loaded correctly by restarting your apache server:

C:\Apache24\bin\httpd.exe -k restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment