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?

1 Answer 1

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.

10
  • 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) Feb 15, 2011 at 9:24
  • Could you just specify a position in the file where I can place it? Feb 15, 2011 at 9: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? Feb 15, 2011 at 9: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 '<VirtualHost ...> ... </VirtualHost>'. Just stick it at the end of the main httpd.conf file will be fine. Feb 15, 2011 at 15:06
  • Well I was following a tutorial that had me compile it against 2.5... Feb 15, 2011 at 23:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .