extern val directory : your_path -> ^Vhost & Location => [Vhost & !Location];
{{Set some configuration specific to a URI prefix or filesystem directory,
respectively.}}
+
+extern val serverAlias : your_domain_host -> [Vhost];
+{{Give an alternate hostname for this vhost.}}
extern val unset_options : [apache_option] -> [^Vhost];
{{Specify some options to be set or unset, leaving the rest as they are.}}
+extern val directoryIndex : [no_spaces] -> [^Vhost];
+{{Give the list of filenames to try for the default page of a directory, to be
+ considered in the order given.}}
extern type your_domain;
{{A domain that you're allowed to configure}}
+extern type your_domain_host;
+{{Some host (as a fully-qualified domain name) in one of your domains}}
+
extern type node;
{{The name of a server controlled by domtool}}
orelse ch = #"-" orelse ch = #"_") path
andalso SS.exists (fn s' => path = s' orelse String.isPrefix (s' ^ "/") path) (your_paths ())
+fun yourDomainHost s =
+ let
+ val (pref, suf) = Substring.splitl (fn ch => ch <> #".") (Substring.full s)
+ in
+ print ("pref[" ^ Substring.string pref ^ "] suf[" ^ Substring.string suf ^ "]\n");
+ Substring.size suf > 0
+ andalso validHost (Substring.string pref)
+ andalso yourDomain (Substring.string
+ (Substring.slice (suf, 1, NONE)))
+ end
+
val _ = Env.type_one "no_spaces"
Env.string
(CharVector.all (fn ch => not (Char.isSpace ch)))
Env.string
yourDomain
+val _ = Env.type_one "your_domain_host"
+ Env.string
+ yourDomainHost
+
val _ = Env.type_one "your_user"
Env.string
yourUser
file
end)
nodes;
- write "\tSuexecUserGroup ";
+ write "\tServerName ";
+ write fullHost;
+ write "\n\tSuexecUserGroup ";
write user;
write " ";
write group;
app (fn opt => (write " -"; write opt)) opts;
write "\n"))
+val () = Env.action_one "directoryIndex"
+ ("filenames", Env.list Env.string)
+ (fn opts =>
+ (write "\tDirectoryIndex";
+ app (fn opt => (write " "; write opt)) opts;
+ write "\n"))
+
+val () = Env.action_one "serverAlias"
+ ("host", Env.string)
+ (fn host =>
+ (write "\tServerAlias ";
+ write host;
+ write "\n"))
+
end
end;
vhost "proxy" with
+ serverAlias "proxy2.hcoop.net";
+
proxyPass "/proxyLand" "http://localhost:1234/otherProxyLand";
proxyPassReverse "/proxyLand" "http://localhost:1234/otherProxyLand";
vhost "lists" with
proxyPass "/mailman" "http://hcoop.net/cgi-bin/mailman";
- alias "/doc/mailman" "/home/adamc/mailman"
+ alias "/doc/mailman" "/home/adamc/mailman";
+
+ directoryIndex ["index.sml", "index.h", "index.v"]
end
end