On Jan 6, 6:26 am, Ian Bicking <i...@colorstudy.com> wrote:
> eleith wrote:
> > i've got a domain: example.com
>
> > i want to run ten different websites (sub1.example.com,
> > sub2.example.com .... sub10.example.com)
>
> > a different pylons app will be running each of the 10 websites
>
> > i'm proxying scgi from lighttpd (10 entries, each website running on
> > port 5001, 5002 ... 5010)
>
> > i have a script that can start all 10 pasters on bootup
>
> > so, if i wanted to add an 11th website, i would
>
> > 1) use up another port, 5011
> > 2) add another proxy within lighttpd
> > 3) modify my paster shell to start up yet another paster server on
> > bootup
>
> > is there a better way to go about this, so this scales better and can
> > be easier to maintain? taking up another port, starting up yet another
> > paster process seem like it can get a bit too resource intensive if
> > all i want to do is just to run different websites (virtual hosts)
>
> You can use urlmap if you want, and host all the sites in the same
> Python instance.  urlmap can do domain-based dispatch, like:
>
> [composite:main]
> use = egg:Paste#urlmap
> domain sub1.example.com / = config:sub1.ini
> domain sub2.example.com / = config:sub2.ini
>
> and so on, and each config file is like development.ini

For which though one does have to be careful though that the
applications don't have conflicting requirements as configuration of
third party modules used, or for operating system things like locale,
timezone etc. Where common modules are used, global data held by those
modules can also be an issue if different applications want to set
them to different things. Especially can be an issue where used for
caching data to a specific application as that data then may leak into
other applications.

Another option is to use Apache/mod_wsgi. In Apache/mod_wsgi it will
automatically separate the application for each WSGI script file into
a separate sub interpreter within the same process. The default is
also that embedded mode is used, ie., runs in Apache child worker
processes, but one can also use mod_wsgi daemon mode instead, which is
a fastcgi like mode except that mod_wsgi will automatically handle
process creation and management, plus automatically deal with the
socket used for communicating with the daemon process. So, very little
for you to worry about except a few lines in a configuration file.

In using daemon mode you can also start to separate out each WSGI
application into separate daemon processes if you still need them in
separate processes. This may still be the case where each application
has different timezone requirements as that is an operating system
level setting that would otherwise be shared between sub interpreters
in the same process.

May sound complicated, but once you have Apache running, setting up
mod_wsgi to do all this is actually fairly simple. It is also quite
flexible as far as what mode and what processes you want things to run
in.

For more information see:

  http://www.modwsgi.org
  http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
  http://code.google.com/p/modwsgi/wiki/IntegrationWithPylons

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