Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check which Python interpreter is used to run WSGI scripts in apache2?

For example, there're two versions of django (1.1, 1.4) installed on the server, and two versions of python(2.6,2.7) as well. Is there a way to check which version of python/library is being used by WSGI?

(in other words, is there a way to check which interpreter is used to run the scripts under /etc/apache2/wsgis-available/ directory)

like image 819
Hanfei Sun Avatar asked Jul 23 '13 02:07

Hanfei Sun


People also ask

How do I check my Wsgi mod version?

In your WSGI application look at the value of mod_wsgi. version in the WSGI environ dictionary. That or import mod_wsgi module in a WSGI application running under mod_wsgi (not command line Python) and print out mod_wsgi. version from that module.

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 is Wsgipythonhome?

Used to indicate to Python when it is initialised where its library files are installed.


1 Answers

Running ldd Or Dependency Walker against the mod_wsgi module will tell you which version of the Python library it was built against.

e.g.

ldd <PATH TO YOUR MOD_WSGI MODULE>/mod_wsgi.so

more documentation here

like image 144
Ignacio Vazquez-Abrams Avatar answered Sep 29 '22 13:09

Ignacio Vazquez-Abrams