On Jul 21, 6:55 pm, Frank <b...@metrico.lu> wrote:
> Hello list,
>
> I am taking my first steps with pylons and really enjoy developing
> with it. Much better than my previous PHP experiences :-). But now on
> to my question:
>
> I plan to run several pylons applications on my server. One would be
> my "CMS", another serves maps for internet and desktop gis mapping
> applications after the WMS standard, and the third planned would serve
> ajax requests for certain data.

FWIW, you will find that Pylons folks would tend to recommend you run
each with a separate Paste server instance behind mod_proxy of your
preferred web server.

> Now I wonder if there are any problems concerning this setup. I would
> define several WSGIScriptAlias'es for different urls (/wms, or /ajax
> and /)

No there isn't, however, if that is all you do then likely you will
end up running it in embedded mode which would not be recommended,
specially if you are still running mod_php and are therefore using
prefork MPM with Apache. For why, see:

  http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html

You would be better off using mod_wsgi daemon mode and perhaps go as
far as have a separate daemon process group for each application as
well as force the application to run in the main interpreter of their
respective processes to avoid issues with third party C extension
modules for Python that don't work properly with sub interpreters.

That said, even if run in same processes, mod_wsgi will ensure each is
separated by running in separate sub interpreters of those processes.

Do be aware that if they can run in the same interpreter, then you
could always use Pylons to compose the applications together rather
that using multiple WSGIScriptAlias directives. That is, use only one
WSGIScriptAlias for '/' and let Pylons sort out mounting unique WSGI
applications where required in one combine application.

> From how I understand the pylons book it is not possible to use
> virtualenv with mod_wsgi?

I don't know what the Pylons book says, but one can use virtualenv
with mod_wsgi. Read:

  http://code.google.com/p/modwsgi/wiki/VirtualEnvironments

> it should be easy for me to avoid conflicting url name spaces, but is
> there more?

As long as the WSGIScriptAlias directives are in correct order such
that sub URL mounted applications come first, ie., before that for
'/', no problem with mounting more than one application through
mod_wsgi.

If mounting under same site, only other thing I can think of off the
top of my head that can cause issues is different applications using
same cookie names and not restricting path for cookie to URL where
application is mounted.

> Or should I setup a virtual host in apache for each
> application, maybe separated by a different port?

There is no need for separate virtual hosts or ports. You would only
need separate virtual hosts if you actually wanted them to be under
different host names. If different sub URLs of same site is
acceptable, then don't need to go to that extent.

> Any help setting up my server is greatly appreciated ...

Ensure you read the actual mod_wsgi documentation and not rely on just
what may be in Pylons documentation or anything you might find on some
ones blog. Documentation is at:

  http://code.google.com/p/modwsgi/

Start with:

  http://code.google.com/p/modwsgi/wiki/InstallationInstructions
  http://code.google.com/p/modwsgi/wiki/DeveloperGuidelines

Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to