Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip install mod_wsgi, How to Set MOD_WSGI_APACHE_ROOTDIR environment?

I am trying to install mod_wsgi in Windows 10.

The command pip install mod_wsgi is giving me error,

RuntimeError: No Apache installation can be found. Set the MOD_WSGI_APACHE_ROOTDIR environment to its location.

My Apache dir is F:\Apache24\.

My question is, how to setup MOD_WSGI_APACHE_ROOTDIR environment ?

Thanks, Sambhav

like image 671
Kumar Sambhav Pandey Avatar asked Feb 19 '17 05:02

Kumar Sambhav Pandey


People also ask

Where does pip install mod_wsgi?

In Short: By default the installation looks for Apache in C:\Apache24 , C:\Apache22 and C:\Apache2 , as your installation is none of these you need to set the environment variable MOD_WSGI_APACHE_ROOTDIR to the path you have installed it to.

Where is mod_wsgi so?

If installing the Apache module by hand, the file is called 'mod_wsgi.so'. The compiled Apache module can be found in the “. libs” subdirectory. The name of the file should be kept the same when copied into its appropriate location.

What does mod_ wsgi do?

mod_wsgi is an Apache HTTP Server module by Graham Dumpleton that provides a WSGI compliant interface for hosting Python based web applications under Apache. As of version 4.5. 3, mod_wsgi supports Python 2 and 3 (starting from 2.6 and 3.2).


1 Answers

Referring to the docs at http://modwsgi.readthedocs.io/en/develop/release-notes/version-4.5.12.html should help you.

In Short:

By default the installation looks for Apache in C:\Apache24, C:\Apache22 and C:\Apache2, as your installation is none of these you need to set the environment variable MOD_WSGI_APACHE_ROOTDIR to the path you have installed it to.

On your system you would do this by running this in your command prompt:

set "MOD_WSGI_APACHE_ROOTDIR=F:\Apache24"

Which sets the variable, and then you can run the pip command (in the same command prompt):

pip install mod_wsgi


To read more about the set command run set /? in command prompt.

like image 72
Alisdair Robertson Avatar answered Sep 21 '22 11:09

Alisdair Robertson