Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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.

share|improve this answer
    
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 9:24
    
Could you just specify a position in the file where I can place it? –  jasonaburton Feb 15 '11 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? –  jasonaburton Feb 15 '11 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. –  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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.