Hi Graham, One final question. The scripts above required a wsgi file per site. I've rewritten it to direct all the sites through a single .wsgi file, then used thin wrapper round the application to send it on its way to the correct (django) settings based on environs settings. This seems to work pretty well, even though it removes the 'touch' reloading method.
But I'm concerned whether this script might be setting itself up for a fall due to the way modwsgi is handling apache processes in embedded mode since a new application group is being defined for each site (which it needs to be since each site may be operating in different virtualenv)? Isn't this what the daemon process mode is for? I'm thinking of this line from the Configuration Guidelines: 'Where multiple applications, potentially owned by different users, need to be run, 'daemon' mode of mod_wsgi should instead be used." If that's true can the daemon process name be defined dynamically? Or does this method necessarily require embedded mode? Once again, many thanks for your advice on this. Ben On Mar 15, 12:20 am, Graham Dumpleton <[email protected]> wrote: > Bouncing this back onto list for general interest. > > 2009/3/15 [email protected] <[email protected]>: > > > > > Been meaning to do this for ages now. Thanks Graham for all your help > > in other posts about this. Anyhow, following on from the thread as > > mentioned above, script below includes media handling, using > > VirtualDocumentRoot as mentioned above. The hard work was really > > already done above and this one has been modified to handle > > subdomains, using the subdomain name to identify the relevant > > folders. > > > I only just got it work and have posted it in a slightly overexcited > > way so probably needs tidying and strengthening. But any obvservations > > most welcome (yup favicon not handled), thanks: > > > RewriteEngine on > > RewriteMap tolower int:tolower > > > VirtualDocumentRoot /home/sites/static/%1/ > > > <Directory /home/sites/static/* > > > Order deny,allow > > Allow from all > > </Directory> > > > RewriteCond %{HTTP_HOST} ^([^.]+)\.domain\.co\.uk$ [NC] > > RewriteRule . - [E=subdomain:%1] > > > RewriteCond %{REQUEST_URI} !^/media/* > > RewriteCond %{REQUEST_URL} !^favicon.ico > > RewriteRule ^/(.*) /home/sites/init/modwsgi/${tolower:% > > {ENV:subdomain}}/django.wsgi/$1 > > RewriteRule . - [E=APPLICATION_GROUP:${tolower:%{SERVER_NAME}}] > > > WSGIProcessGroup %{GLOBAL} > > WSGIApplicationGroup %{ENV:subdomain} > > > <Directory /home/sites/init/modwsgi/* > > > Order allow,deny > > Allow from all > > Options ExecCGI > > AddHandler wsgi-script .wsgi > > </Directory> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en -~----------~----~----~----~------~----~------~--~---
