Installing Mod - Wsgi On Windows: Install Python
Installing Mod - Wsgi On Windows: Install Python
Installing Mod - Wsgi On Windows: Install Python
Windows
Install python
Download the python installer
from https://www.python.org/downloads/windows/ and execute it. Make sure that
it’s being installed for all users (it will install to C:\Program Files\Python ), you
might need to use the “Customize installation” option.
Once the process is done open a prompt and try running the following commands.
python -V
pip -V
It should print both the version of the python interpreter and the python installer.
Note that the “Visual C++ redistributable package” installs just the runtime
components. For this we need the build tools package.
Upgrade setuptools
Open a command prompt and run:
Install mod_wsgi
If the Apache httpd instance is installed in a path other
than C:\Apache\Apache24 (Apache Lounge’s default installation path)
the MOD_WSGI_APACHE_ROOTDIR environment variable will need to be set. In this
case I had to set it to the following path C:\Program Files (x86)\Apache
Software Foundation\Apache
If everything is alright it should just display a message announcing that the package
has been installed.
Configure mod_wsgi
After installing the mod_wsgi package some configuration is needed.
In order to obtain the proper paths for we need to run the following command:
mod_wsgi-express module-config
LoadFile
"c:/users/eis/appdata/local/programs/python/python38/python38.dll
"
LoadModule wsgi_module
"c:/users/eis/appdata/local/programs/python/python38/lib/site-
packages/mod_wsgi/server/mod_wsgi.cp38-win_amd64.pyd"
WSGIPythonHome
"c:/users/eis/appdata/local/programs/python/python38"
This output will then need to be copied in the conf/httpd.conf file or other
relevant configuration file in the Apache httpd installation folder.
Upon restarting Apache httpd the server control window should now display a new
item in the status bar that reads “mod_wsgi”.
5. C:\xampp\apache\conf\httpd.conf
6. C:\xampp\apache\conf\ httpd-vhosts.conf
<VirtualHost *:83>
ServerName gisapi
DocumentRoot C:/xampp/htdocs/GISApi/GISApi
<Directory "C:/xampp/htdocs/GISApi/GISApi">
AllowOverride All
</Directory>
<Directory "C:/xampp/htdocs/GISApi/GISApi/static">
</Directory>
WSGIScriptAlias / C:/xampp/htdocs/GISApi/GISApi/GISApi/wsgi.py
<Directory "C:/xampp/htdocs/GISApi/GISApi/GISApi">
<Files wsgi.py>
</Directory>
</VirtualHost>