Take the 2-minute tour ×
Server Fault is a question and answer site for 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

closed as off-topic by Katherine Villyard, masegaloeh, 84104, Ward, Scott Pack Apr 17 at 3:03

  • This question does not appear to be about server, networking, or related infrastructure administration within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

4  
Questions involving web hosting control panels are off-topic at Server Fault because they customize their systems beyond our ability to support, and thus require support from the vendor or the web hosting industry. See Where can I ask questions about web hosting control panels? –  Katherine Villyard Apr 16 at 21:33
1  
@KatherineVillyard Not entirely sure why you commented on a 3 year old question, but I know that this question is off-topic now. What a blast of nostalgia, I've come along way since this question :) –  Brandon Wamboldt Apr 17 at 0:45
1  
Hi, Brandon! We're on a big web hosting control panel purge, and your question came up in a search. It was probably on topic in 2012 when you asked it, so no offense meant. :) –  Katherine Villyard Apr 17 at 0:49

2 Answers 2

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
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

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