0

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>
Brandon
  • 426
  • 5
  • 17
  • 4
    **Questions involving web hosting control panels** are off-topic at [sf] because they [customize their systems beyond our ability to support](http://meta.serverfault.com/q/8055), and thus require support from the vendor or the web hosting industry. See [Where can I ask questions about web hosting control panels?](http://meta.serverfault.com/q/8094) – Katherine Villyard Apr 16 '15 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 Apr 17 '15 at 00: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 '15 at 00:49

2 Answers2

0

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.

Graham Dumpleton
  • 6,090
  • 2
  • 21
  • 19
0

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

Brandon
  • 426
  • 5
  • 17