close ()
end)
+val () = Env.actionV_one "mailmanVhost"
+ ("host", Env.string)
+ (fn (env, host) =>
+ let
+ val nodes = Env.env (Env.list Env.string) (env, "WebNodes")
+
+ val ssl = Env.env Apache.ssl (env, "SSL")
+ val user = Env.env Env.string (env, "User")
+
+ val fullHost = host ^ "." ^ Domain.currentDomain ()
+ val vhostId = fullHost ^ (if Option.isSome ssl then ".ssl" else "")
+ val confFile = fullHost ^ (if Option.isSome ssl then ".vhost_ssl" else ".vhost")
+ in
+ app (fn node =>
+ let
+ val file = Domain.domainFile {node = node,
+ name = confFile}
+ fun print s = TextIO.output (file, s)
+
+ val ld = Apache.logDir {user = user, node = node, vhostId = vhostId}
+ in
+ print "<VirtualHost ";
+ print (Domain.nodeIp node);
+ print ":";
+ print (case ssl of
+ SOME _ => "443"
+ | NONE => "80");
+ print "\n";
+ print " ServerName $LISTDOMAIN\n";
+ print " ServerAdmin ";
+ print user;
+ print "@hcoop.net\n";
+ print " SuexecUserGroup list list\n";
+ print "\n";
+ print " ErrorLog ";
+ print ld;
+ print "/error.log\n";
+ print " CustomLog ";
+ print ld;
+ print "/access.log combined\n";
+ print "\n";
+ print " RewriteEngine on\n";
+ print "\n";
+ print " # Default to showing listinfo page\n";
+ print " RewriteRule ^/$ http://";
+ print fullHost;
+ print "/listinfo/\n";
+ print "\n";
+ print " Alias /images/mailman /usr/share/images/mailman\n";
+ print " Alias /pipermail /var/lib/mailman/archives/public\n";
+ print "\n";
+ print " DocumentRoot /usr/lib/cgi-bin/mailman\n";
+ print " <Directory /usr/lib/cgi-bin/mailman>\n";
+ print " AllowOverride None\n";
+ print " Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch\n";
+ print " ForceType cgi-script\n";
+ print " Order allow,deny\n";
+ print " Allow from all\n";
+ print " </Directory>\n";
+ print "\n";
+ print " <Directory /usr/share/doc/mailman>\n";
+ print " Order allow,deny\n";
+ print " Allow from all\n";
+ print " </Directory>\n";
+ print "</VirtualHost>\n";
+
+ TextIO.closeOut file
+ end) nodes
+ end)
+
val mailmanChanged = ref false
val () = Slave.registerPreHandler (fn () => mailmanChanged := false)