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've installed mod_wsgi on my Plesk server, but I can't get it to behave the way I'd like. If I add

WSGIScriptAlias /python /var/www/vhosts/domain.com/httpdocs/python/test.wsgi

To my config file, going to http://domain.com/python/blah triggers my test.wsgi script. However, going to any domain on my server and adding /python triggers my script as well. How can I limit it to one specific domain without breaking anything in Plesk?

Right now I've tried this and it doesn't work

<Directory /var/www/vhosts/domain.com/httpdocs/python>
        WSGIApplicationGroup %{GLOBAL}
        AddHandler wsgi-script .wsgi
        Options ExecCGI
        Order allow,deny
        Allow from all
</Directory>
share|improve this question
add comment

2 Answers

The WSGIScriptAlias needs to be specified inside of the VirtualHost for site you want it defined in. You must have it outside, or you are not using conventional virtual host mechanisms.

share|improve this answer
add comment
up vote 0 down vote accepted

Turns out I was pretty close to an answer. I changed my config to this:

<Directory /var/www/vhosts/>
        AddHandler wsgi-script .wsgi 
        Options +ExecCGI
</Directory>

Which now lets me run .wsgi files in any directory I want. I can combine that with .htaccess files to get roughly the same behaviour as I had with PHP

share|improve this answer
add comment

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.