Hello Eric,
On 24-ene-09, at 03:49, Eric Drechsel wrote:
> I want to ask about how one would recommend to manipulate the Cherokee
> configuration from a script.
>
> I'm seeking to integrate Aegir [1] , the Drupal site provisioning
> system with Cherokee. Aegir currently only integrates with Apache [2],
> but in a very simple way: when a new site is added,
> ${APACHE_CONF}/sites/sitename.conf is created with a VirtualHost
> directive, and the webserver is reloaded, and when a site is deleted
> the conf file is deleted and the webserver reloaded.
>
> I want to add support for Cherokee. I see two principle ways:
> * seperate vhost per site
> * one vhost per deployment, with additional domains added as needed
>
> For simplicity of maintenance etc I'd prefer to have just one vhost.
> Any performance differences one way or the other for large numbers of
> sites?
>
> Apache allows wildcard includes (<Include "sites/*.conf">) so that new
> confs can be added/removed simply by adding/removing a file. Any plans
> to support this type of conf file structure in Cherokee? The current
> conf file format would not seem to allow includes.
>
> My impression is that the best approach would be to programmatically
> add/remove domains from a single vhost section. Is there a parser that
> I could use to do this, or should I just roll my own regex? I know
> there was some discussion of parsers etc in previous months.
There are two options:
- The first one is to work with a single configuration file. In
this case, you'd have to add/remove virtual servers (or
domains) right from there. It isn't a tough task once you get
to know how the configuration file format works, although you'd
need some sort of parsing class. This Python class[1] that
we've written for Cherokee-admin may be useful for you.
With that class you can walk trough the whole configuration
tree, cut, move and rename branches, etc. For instance, if you
wanted to remove a virtual server, it'd enough with:
del(config['vserver!%d']%(num))
- The second choice would be to use file inclusions. The server
does support configuration files/directories inclusion,
although its use is discouraged. In this case, you could use:
include = /path/to/file/or/dir
or
try_include = /path/to/file/or/dir
There is a problem about this, though. Since virtual server are
ordered (they are indexed by an integer value), you'd have to
take care of those values.
At this moment, I'd recommend you to use a single file and a
parsing class.
By the way, the delegation of configuration pieces is a topic
currently being discussed. It'd be pretty interesting to hear any
comment on Aegir, so we can make better decisions on this regard.
1.- http://svn.cherokee-project.com/browser/cherokee/trunk/admin/config.py
--
Octality
http://www.octality.com/
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee