Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Because Alias and WSGIScriptAlias are at different precedence levels, you cannot create a multi level overlapping set of URLs of more than 2 levels which alternates between use of them. The solution is to use Alias/AliasMatch directives for all sub URLs, that way they are evaluated at same level of precedence. One can still use WSGIScriptAlias for root of site.</p> <p>Thus try using following with directives in order such that most nested URL patterns earlier than outer URLs.</p> <pre><code>&lt;VirtualHost *:8080&gt; #DocumentRoot /var/www/mydomain.com/public ServerName mydomain.com ErrorLog /var/www/mydomain.com/logs/apache_error_log CustomLog /var/www/mydomain.com/logs/apache_access_log common AliasMatch ^/(media/foo/bar/.*) /var/www/mydomain.com/src/myproject/server/django.wsgi/$1 Alias /media/ /var/www/mydomain.com/public/media/ WSGIScriptAlias / /var/www/mydomain.com/src/myproject/server/django.wsgi &lt;Directory /var/www/mydomain.com/src/myproject/server&gt; Options ExecCGI AddHandler wsgi-script .wsgi # WSGIApplicationGroup %{GLOBAL} Order allow,deny Allow from all &lt;/Directory&gt; &lt;Directory /var/www/mydomain.com/public/media&gt; Order deny,allow Allow from all &lt;/Directory&gt; &lt;/VirtualHost&gt; </code></pre> <p>The AliasMatch is used for the most nested as we need to adjust the value of SCRIPT_NAME, ie., mount point, seen by Django application so that request still seems to be for Django instance mounted at root. If don't do that, urls.py patterns will not work as you expect for that sub URL. Use of AliasMatch and adding matched sub pattern to RHS after script path using $1 achieves that.</p> <p>Although Django mounted via two different directives, calculated SCRIPT_NAME should be same for both and so same Python sub interpreter should be used. If for some reason you think your memory use is twice what you expect, ie., two instances of Django running in different sub interpreters, you can force them to run in same by uncommenting WSGIApplicationGroup directive above. This shouldn't be required though and if think you do need it, better off going to mod_wsgi mailing list and can instruct you on how to verify whether doing as it should be and what is wrong.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload