9

I have searched the entire file for a place to put the directive, but I have no idea where to put it, and the internet doesn't seem to have a good answer either, or maybe I'm just not good at searching for it hehe.

Anybody know where this directive is to be placed?

jasonaburton
  • 263
  • 1
  • 4
  • 9

1 Answers1

4

It should go outside of any VirtualHost directives. See:

http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPythonHome

Per definitions at:

http://httpd.apache.org/docs/2.2/mod/directive-dict.html#Context

and linked from context label for the entry, the value 'server config' means:

"""This means that the directive may be used in the server configuration files (e.g., httpd.conf), but not within any or containers. It is not allowed in .htaccess files at all."""

More importantly, do you really need to set it?

There are only certain times you would want to use WSGIPythonHome. Often people try and use it for the wrong reasons.

Graham Dumpleton
  • 5,990
  • 2
  • 20
  • 19
  • I have both python 2.4 and 2.5 installed on my VPS and I want the mod_wsgi to use 2.5 so I need to set WSGIPythonHome to the directory that holds 2.5. Correct? And it's not very clear to me what you mean by "outside of any virtualhost directives" (I'm very new to this, sorry) – jasonaburton Feb 15 '11 at 09:24
  • Could you just specify a position in the file where I can place it? – jasonaburton Feb 15 '11 at 09:25
  • Like, after reading the httpd.conf file, there are 3 parts to it, which part do I put the directive in, and where at in that specific part? – jasonaburton Feb 15 '11 at 09:26
  • If your Python 2.4 and 2.5 are installed under the same root, ie., /usr, then so long as mod_wsgi was compiled for Python 2.5 it should work without setting WSGIPythonHome. BTW, you cannot use WSGIPythonHome to point mod_wsgi at Python 2.5 if it was origially compiled for mod_wsgi 2.4. Where are the two Python installations located? Outside of any virtual host means at global scope, ie., not between ' ... '. Just stick it at the end of the main httpd.conf file will be fine. – Graham Dumpleton Feb 15 '11 at 15:06
  • Well I was following a tutorial that had me compile it against 2.5... – jasonaburton Feb 15 '11 at 23:45
  • If you can, just install the binary package available for your distribution and the specific version of Python that your distribution is using. What distribution are you using? – Graham Dumpleton Feb 16 '11 at 03:55
  • I looked up each version of the module and I cannot find the mod_wsgi that is compatible with python 2.4...if I could that package it would solve all my problems. – jasonaburton Feb 16 '11 at 04:35
  • I'm working on CentOS 5.5 and I need mod_wsgi installed, but the package is unavailable. I tried installing other packages (version 1.3, 2.1, 2.4, 2.5, etc - of the mod_wsgi module) but they require either python 2.3 or 2.5, I need the mod_wsgi for python 2.4 but I can't find it... – jasonaburton Feb 16 '11 at 04:45
  • Either way, since you are installing distribution Python versions, and thus they would be installed under /usr, you do not need to set WSGIPythonHome. All that is required is that when you configure mod_wsgi source code for building, you specify '--with-python=/usr/bin/python2.5' as option to 'configure'. Everything else should work fine without then specifying WSGIPythonHome. You only need that directive when Python version is installed in non standard location. – Graham Dumpleton Feb 16 '11 at 06:00
  • I did install it in a non-standard location. Anyways, I went a different route (completely unrelated to this topic). Thanks for your help nonetheless :) – jasonaburton Feb 16 '11 at 08:55