welcome: please sign in

Diff for "DomTool/Plugins"

Differences between revisions 2 and 4 (spanning 2 versions)
Revision 2 as of 2006-12-16 22:30:11
Size: 2633
Editor: AdamChlipala
Comment:
Revision 4 as of 2006-12-16 23:11:12
Size: 4969
Editor: AdamChlipala
Comment: HCoop, Mailman, Webalizer
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
Each `vhost "$HOST"` directive creates a `$HOST.vhost` file in `$DOMTOOL/nodes`. A change handler for `.vhost` files copies them to `/var/domtool/vhosts`. A post-handler rsyncs `/var/domtool/vhosts` to `/etc/apache2/vhosts` after any vhost has changed. After that, it runs `/etc/init.d/apache2 reload` to reload configuration. Each `vhost "$HOST"` directive creates a `$HOST.vhost` file in `$DOMTOOL/nodes`. A change handler for `.vhost` files copies them to `/var/domtool/vhosts`. A post-handler runs `domtool-publish apache`, which rsyncs `/var/domtool/vhosts` to `/etc/apache2/vhosts` after any vhost has changed and runs `/etc/init.d/apache2 reload` to reload configuration.
Line 21: Line 21:
BIND configuration directives are written to `dns` files in the `$DOMTOOL/nodes` directories of the appropriate nodes/domains. These `dns` files contain all of the contents of a BIND zonefile, with the exception of the SOA record. This is handled by main DomTool code and written in a stylized form to `soa` files. The BIND plugin registers a change handler looking for modifications to either `dns` or `soa` files. When any are found, `/var/domtool/zones/$DOMAIN.zone` is regenerated from them. A post-handler rsyncs `/var/domtool/zones` to `/etc/bind/zones` and runs `/etc/init.d/bind9 reload`. BIND configuration directives are written to `dns` files in the `$DOMTOOL/nodes` directories of the appropriate nodes/domains. These `dns` files contain all of the contents of a BIND zonefile, with the exception of the SOA record. This is handled by main DomTool code and written in a stylized form to `soa` files. The BIND plugin registers a change handler looking for modifications to either `dns` or `soa` files. When any are found, `/var/domtool/zones/$DOMAIN.zone` is regenerated from them.

The BIND plugin also produces a `named.conf` file for each domain. A change handler notes when some `named.conf` has changed, and a post-handler concatenates all `named.conf` files in `$DOMTOOL/nodes/$NODE` into `/var/domtool/named.conf.local` and runs `domtool-publish bind`, which rsyncs `/var/domtool/zones` to `/etc/bind/zones`, copies `/var/domtool/named.conf.local` to `/etc/bind/`, and runs `/etc/init.d/bind9 reload`.

= Exim =

'''Modules:''' [http://deleuze.hcoop.net/domtool/alias.html Alias], [http://deleuze.hcoop.net/domtool/exim.html Exim]

The Exim plugin maintains three kinds of files in domain configuration directories:
 * `aliases`, e-mail aliases to be concatenated into `/etc/aliases`
 * `aliases.default`, e-mail aliases to be concatenated into `/etc/aliases.default`
 * `mail` files that, if non-empty, should contain the current domain's name, indicating that the current node should provide relaying for any mail addressed to that domain

A post-handler performs the concatenation over all domains of the three classes into `/var/domtool/aliases`, `/var/domtool/aliases.default`, and `/var/domtool/local_domains.cfg`, respectively; and then runs `domtool-publish exim`, which copies the first two files to `/etc/` and `local_domains.cfg` (which is in the form of a colon-separated list) to `/etc/exim4`, and then runs `/etc/init.d/exim4 reload`.

= HCoop =

'''Modules:''' [http://deleuze.hcoop.net/domtool/hcoop.html Hcoop]

This plug-in currently only provides useful HCoop-specific `extern` functions.

= Mailman =

'''Modules:''' [http://deleuze.hcoop.net/domtool/mailman.html Mailman]

The `mailmanWebHost` action writes a domain file `mailman`, recording the default Mailman vhost for that domain. A post-handler concatenates all of these into `/var/domtool/mailman.map` in a format suitable for a Python association list in Mailman configuration, and runs `domtool-publish mailman`, which copies that file to `/etc/mailman`.

= Webalizer =

'''Modules:''' none

This plugin works entirely through the before/after vhost hooks provided by the Apache plugin. For each vhost `$VHOST` on node `$NODE`, it writes to `$DOMTOOL/webalizer/config/$NODE/$VHOST.conf` Webalizer configuration that will generate statistics for that vhost. The output HTML and images are directed to `$DOMTOOL/webalizer/output/$NODE/$VHOST/`, which the plugin ensures exists.

This page is aimed at admins; that is, people with root privileges on our servers. Most members should probably consult DomTool/UserGuide instead.

This page documents the different DomTool plugins, which provide the primitive actions that can be used to configure particular "real" daemons.

TableOfContents()

1. Apache

Modules: [http://deleuze.hcoop.net/domtool/apache.html Apache], [http://deleuze.hcoop.net/domtool/apache_auth.html Apache_auth], [http://deleuze.hcoop.net/domtool/apache_options.html Apache_options], [http://deleuze.hcoop.net/domtool/mod_autoindex.html Mod_autoindex], [http://deleuze.hcoop.net/domtool/mod_rewrite.html Mod_rewrite], [http://deleuze.hcoop.net/domtool/proxy.html Proxy], [http://deleuze.hcoop.net/domtool/urls.html Urls]

Each vhost "$HOST" directive creates a $HOST.vhost file in $DOMTOOL/nodes. A change handler for .vhost files copies them to /var/domtool/vhosts. A post-handler runs domtool-publish apache, which rsyncs /var/domtool/vhosts to /etc/apache2/vhosts after any vhost has changed and runs /etc/init.d/apache2 reload to reload configuration.

The Apache plugin also manages creation and deletion of log directories. Each member should have an apache/log subdirectory of his AFS volume root, owned by domtool with read permissions for the member. The plugin creates a directory /afs/hcoop/usr/$USER/apache/log/$NODE/$HOST for each virtual host running on $NODE as $USER with full hostname $HOST. When a vhost is deleted, the plugin deletes its log directory. Since this can't be done while Apache is running, because the daemon maintains open file handles to logs, the plugin has to take Apache down until configuration is finished, reloading it afterward. Hopefully domains aren't deleted very often, so this shouldn't be much of a problem.

Apache also provides hooks that other plugins can use to request callbacks just before and/or after a vhost is configured.

2. BIND

Modules: [http://deleuze.hcoop.net/domtool/bind.html Bind]

BIND configuration directives are written to dns files in the $DOMTOOL/nodes directories of the appropriate nodes/domains. These dns files contain all of the contents of a BIND zonefile, with the exception of the SOA record. This is handled by main DomTool code and written in a stylized form to soa files. The BIND plugin registers a change handler looking for modifications to either dns or soa files. When any are found, /var/domtool/zones/$DOMAIN.zone is regenerated from them.

The BIND plugin also produces a named.conf file for each domain. A change handler notes when some named.conf has changed, and a post-handler concatenates all named.conf files in $DOMTOOL/nodes/$NODE into /var/domtool/named.conf.local and runs domtool-publish bind, which rsyncs /var/domtool/zones to /etc/bind/zones, copies /var/domtool/named.conf.local to /etc/bind/, and runs /etc/init.d/bind9 reload.

3. Exim

Modules: [http://deleuze.hcoop.net/domtool/alias.html Alias], [http://deleuze.hcoop.net/domtool/exim.html Exim]

The Exim plugin maintains three kinds of files in domain configuration directories:

  • aliases, e-mail aliases to be concatenated into /etc/aliases

  • aliases.default, e-mail aliases to be concatenated into /etc/aliases.default

  • mail files that, if non-empty, should contain the current domain's name, indicating that the current node should provide relaying for any mail addressed to that domain

A post-handler performs the concatenation over all domains of the three classes into /var/domtool/aliases, /var/domtool/aliases.default, and /var/domtool/local_domains.cfg, respectively; and then runs domtool-publish exim, which copies the first two files to /etc/ and local_domains.cfg (which is in the form of a colon-separated list) to /etc/exim4, and then runs /etc/init.d/exim4 reload.

4. HCoop

Modules: [http://deleuze.hcoop.net/domtool/hcoop.html Hcoop]

This plug-in currently only provides useful HCoop-specific extern functions.

5. Mailman

Modules: [http://deleuze.hcoop.net/domtool/mailman.html Mailman]

The mailmanWebHost action writes a domain file mailman, recording the default Mailman vhost for that domain. A post-handler concatenates all of these into /var/domtool/mailman.map in a format suitable for a Python association list in Mailman configuration, and runs domtool-publish mailman, which copies that file to /etc/mailman.

6. Webalizer

Modules: none

This plugin works entirely through the before/after vhost hooks provided by the Apache plugin. For each vhost $VHOST on node $NODE, it writes to $DOMTOOL/webalizer/config/$NODE/$VHOST.conf Webalizer configuration that will generate statistics for that vhost. The output HTML and images are directed to $DOMTOOL/webalizer/output/$NODE/$VHOST/, which the plugin ensures exists.

DomTool/Plugins (last edited 2011-04-22 23:05:37 by ClintonEbadi)