fun write s = app (fn file => TextIO.output (file, s)) (!vhostFiles)
val rewriteEnabled = ref false
+val currentVhost = ref ""
+val currentVhostId = ref ""
val () = Env.containerV_one "vhost"
("host", Env.string)
val sadmin = Env.env Env.string (env, "ServerAdmin")
val fullHost = host ^ "." ^ Domain.currentDomain ()
+ val vhostId = fullHost ^ (if ssl then ".ssl" else "")
val confFile = fullHost ^ (if ssl then ".vhost_ssl" else ".vhost")
in
+ currentVhost := fullHost;
+ currentVhostId := vhostId;
+
rewriteEnabled := false;
vhostFiles := map (fn node =>
let
write docroot;
write "\n\tServerAdmin ";
write sadmin;
- write "\n"
+ write "\n\tErrorLog ";
+ write Config.Apache.logDir;
+ write "/";
+ write vhostId;
+ write "/error.log\n\tCustomLog ";
+ write Config.Apache.logDir;
+ write "/";
+ write vhostId;
+ write "/access.log combined\n"
end,
fn () => (write "</VirtualHost>\n";
app TextIO.closeOut (!vhostFiles)))
write "]");
write "\n"))
+val () = Env.action_one "rewriteLogLevel"
+ ("level", Env.int)
+ (fn level =>
+ (checkRewrite ();
+ write "\tRewriteLog ";
+ write Config.Apache.logDir;
+ write "/";
+ write (!currentVhostId);
+ write "/rewrite.log\n\tRewriteLogLevel ";
+ write (Int.toString level);
+ write "\n"))
+
val () = Env.action_two "alias"
("from", Env.string, "to", Env.string)
(fn (from, to) =>
val () = Env.action_none "satisfyAny"
(fn () => write "\tSatisfy any\n")
+val () = Env.action_one "forceType"
+ ("type", Env.string)
+ (fn ty => (write "\tForceType ";
+ write ty;
+ write "\n"))
+
+val () = Env.action_none "forceTypeOff"
+ (fn () => write "\tForceType None\n")
+
+val () = Env.action_two "action"
+ ("what", Env.string, "how", Env.string)
+ (fn (what, how) => (write "\tAction ";
+ write what;
+ write " ";
+ write how;
+ write "\n"))
+
+val () = Env.action_one "addDefaultCharset"
+ ("charset", Env.string)
+ (fn ty => (write "\tAddDefaultCharset ";
+ write ty;
+ write "\n"))
+
end