1. The Model T of Domain Configuration
A lot of folks at least start out with very simple configuration with their domains. In fact, a lot of the domains hosted with HCoop have the exact same configuration, modulo usernames and other blanks to fill in. A standard recipe is:
- Declare our nameservers as authoritative for your domain.
- Declare that Exim should handle e-mail for your domain.
- Direct Exim to send all mail to your domain to your mailbox.
Add a DNS mapping from www.yourdomain.com to our web server's IP address.
Create an Apache virtual host at that hostname serving ~/public_html/.
With the old Domtool, this configuration is scattered throughout a number of files. With Domtool 2, this source code accomplishes it:
dom "yourdomain.com" with end;
Simple, eh? dom is a library function defined elsewhere. For comparison, an equivalent configuration that doesn't use it is:
domain "yourdomain.com" with dns (dnsNS "ns.hcoop.net"); dns (dnsNS "ns2.hcoop.net"); dns (dnsA "www" web_ip); handleMail; mailbox <- Mailbox; catchAllAlias mailbox; vhost "www" with end; end;
Still quite a bit better than what the old Domtool allows!
2. A Very Busy Example
I'm not even going to bother setting out to explain this. Here is a load of configuration sitting in a bucket.
domain "hcoop.net" with dns (dnsNS "ns.hcoop.net"); dns (dnsA "a" "1.2.3.4"); dns (dnsCNAME "b" "a.hcoop.net"); dns (dnsMX 1 "mail.nowhere.eu"); handleMail; emailAlias "someone" "someoneElse"; aliasMulti "me" ["nowhere","smelly@yikes.com"]; catchAllAlias "me@gmail.com"; mailmanWebHost "lists.hcoop.net"; dns (dnsA "www" web_ip); vhost "www" where DocumentRoot = "/home/adamc/html"; ServerAdmin = "my@other.address" with serverAlias "hcoop.net"; addDefaultCharset "mumbo-jumbo/incomprehensible"; location "/theMorgue" with rewriteRule "A" "B" []; end; end; end; domain "schizomaniac.net" where TTL = 1234 with vhost "www" with directory "/home/adamc/thisPlace" with unset_options [includesNOEXEC]; indexOptions [iconsAreLinks, scanHtmlTitles, iconWidth 45]; end end; vhost "proxy" with proxyPass "/proxyLand" "http://localhost:1234/otherProxyLand"; proxyPassReverse "/proxyLand" "http://localhost:1234/otherProxyLand"; end; end;