So, I'm back from holiday and i worked out a solution following your
advice. It seem interesting butstill I'm not sure it's the best
solution. I'll write what I've got so far maybe you can help me with
some sugetions and then I'll explain what is exactly that I'm trying
to build, so maybe you could tell me if this or embedded mode would
work best for me. Thanks

    RewriteEngine On
    RewriteMap tolower int:tolower

    RewriteCond %{REQUEST_URI} ^/uploads/ [OR]
    RewriteCond %{REQUEST_URI} ^/thumbnails/ [OR]
    RewriteCond %{REQUEST_URI} ^/captchas/ [OR]
    RewriteCond %{REQUEST_URI} ^/invoices_pdf/
    RewriteRule ^/(.*) /mnt/data/www/domains/${tolower:%{SERVER_NAME}}/
media/$1

    RewriteCond %{REQUEST_URI} ^/media/ [OR]
    RewriteCond %{REQUEST_URI} ^/uploader/
    RewriteRule ^/(.*) /mnt/data/www/iitcms/$1

    RewriteCond %{REQUEST_URI} ^/admin_media/
    RewriteRule ^/admin_media/(.*) /usr/lib/python2.6/site-packages/
django-trunk/django/contrib/admin/media/$1

    RewriteCond %{REQUEST_URI} ^/(?!uploads|thumbnails|captchas|
invoices_pdf|media|uploader)
    RewriteRule ^/(.*) /mnt/data/www/domains/${tolower:%{SERVER_NAME}}/
apache/django.wsgi/$1

    RewriteRule . - [E=APPLICATION_GROUP:${tolower:%{SERVER_NAME}}]

    WSGIProcessGroup %{GLOBAL}
    WSGIApplicationGroup %{ENV:APPLICATION_GROUP}

    <DirectoryMatch /mnt/data/www/domains/(.+)/apache>
    Order allow,deny
    Allow from all
    Options ExecCGI
    AddHandler wsgi-script .wsgi
    </DirectoryMatch>

(and all the other directories here)

Now, what I am trying to do is configure a server for a kind of CMS
application. A user comes, creates an account and he gets his own site
that he can edit, right then. At the moment the server has cpanel that
creates the user account and creates a virtual host - uses daemon
mode. The problem is that because of this cpanel need to restart
apache after each account is created, so if I have 5 ppl trying to
create an account in roughly the same time one will get through while
the other will get to wait after one another, the waiting interval
being able to go up to 4 or 5 minutes. During all this process apache
restarts and restarts and no other user sites work. This is my problem
and because of this I am trying to find another way. I would want to
keep each user account in daemon mode but I'm not sure there is a way
to do this, so I tried the other approach, using embedded mode, with
the above result. This would keep apache from restarting but other
complications might appear. I'm not sure the 5 users at the same time
will happen very often but I'd rather avoid it if I can.
Which of the above solutions do you think is better? Can you see
another solution, better than what I am trying?
Could you please tell me of a good article about embedded mode and the
problems it might pose in this case. I'll have tons of sites running
under the same process (big fat django sites).

Can I do something using .htaccess maybe? Or can I use mod_rewrite to
define processes for each site, thus making it run in daemon mode?

Thank you,
Virgil

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

Reply via email to