Loading...

modwsgi@googlegroups.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: [modwsgi] Can you mix embedded and daemon mode running under a single apache process? Graham Dumpleton Thu Feb 02 04:05:54 2012

You can mix them.

Interpretation of WSGIProcessGroup is not done in order with other
directives, whichever is last wins.

Since you are using mod_wsgi 3.x one way you can be more precise by doing:

WSGIDaemonProcess app user=admin processes=3 threads=1

WSGIScriptAlias /app/ /var/www/wsgi-scripts/pastedeploy-app.wsgi
process-group=app

WSGIScriptAlias / /var/www/wsgi-scripts/pastedeploy.wsgi

The more long handed way is to use:

WSGIDaemonProcess app user=admin processes=3 threads=1

WSGIScriptAlias /app/ /var/www/wsgi-scripts/pastedeploy-app.wsgi

WSGIScriptAlias / /var/www/wsgi-scripts/pastedeploy.wsgi

<Directory /var/www/wsgi-scripts/>
<Files paste deploy-app.wsgi>
WSGIProcessGroup app
</Files>
</Directory>

In other words, you scope the WSGIProcessGroup to WSGI script fel in file
system.

Rather than Directory/Files, you could also say:

<Location /app>
WSGIProcessGroup app
</Location>

so, as long as isn't qualified in one of those ways, will still run in
embedded mode.

Graham

On Wednesday, 18 January 2012, Jonathan Thomas <
[EMAIL PROTECTED]> wrote:
> I am mostly looking for clarification here since nothing I read in the
> docs specifically says you can't mix embedded and daemon modes,
> although there is an implied either or which seems to be backed up by
> empirical testing.
>
> Which leads me to wonder whether it's possible and I've misconfigured
> my server, or whether it's not possible.
>
> Here is what I'm trying to do in the main server section of the apache
> configuration.  In this scenario lets assume virtual hosts are
> discouraged.  This configuration starts fine, and all urls are
> reachable, but the only processes that are used are the ones defined
> under the DaemonProcess directive (as determined by ps and looking at
> the CPU time)
>
> I'm using
> httpd-2.2.20 in prefork mode
> mod_wsgi-3.3
>
> config snippet
> ...
> User nobody
> ...
> #Serve the first application under a separate user
> WSGIDaemonProcess app user=admin processes=3 threads=1
> WSGIScriptAlias /app/ /var/www/wsgi-scripts/pastedeploy-app.wsgi
> WSGIProcessGroup app
>
> #Then serve everything else using embedded mode.
> WSGIScriptAlias / /var/www/wsgi-scripts/pastedeploy.wsgi
>
> <Directory /var/www/wsgi-scripts>
> Order allow,deny
> Allow from all
> </Directory>
>
>
> A definitive answer would be most welcome, let me know if you need
> more information.
> -Jonathan
>
> --
> 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.
>
>

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