HCoop
/
hcoop
/
domtool2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bbdf617
)
Fix problem noted by omry on original domtool; namely, bad handling of rewrites insid...
author
Adam Chlipala
<adamc@hcoop.net>
Fri, 15 Dec 2006 19:34:17 +0000
(19:34 +0000)
committer
Adam Chlipala
<adamc@hcoop.net>
Fri, 15 Dec 2006 19:34:17 +0000
(19:34 +0000)
src/plugins/apache.sml
patch
|
blob
|
blame
|
history
diff --git
a/src/plugins/apache.sml
b/src/plugins/apache.sml
index
24b424e
..
91209af
100644
(file)
--- a/
src/plugins/apache.sml
+++ b/
src/plugins/apache.sml
@@
-29,6
+29,10
@@
val _ = Env.type_one "web_node"
orelse (Domain.hasPriv "www"
andalso List.exists (fn x => x = node) Config.Apache.webNodes_admin))
orelse (Domain.hasPriv "www"
andalso List.exists (fn x => x = node) Config.Apache.webNodes_admin))
+val _ = Env.registerFunction ("web_node_to_node",
+ fn [e] => SOME e
+ | _ => NONE)
+
val _ = Env.type_one "proxy_port"
Env.int
(fn n => n > 1024)
val _ = Env.type_one "proxy_port"
Env.int
(fn n => n > 1024)
@@
-68,10
+72,6
@@
val _ = Env.type_one "location"
val dl = ErrorMsg.dummyLoc
val dl = ErrorMsg.dummyLoc
-val _ = Env.registerFunction ("web_node_to_node",
- fn [e] => SOME e
- | _ => NONE)
-
val _ = Defaults.registerDefault ("WebNodes",
(TList (TBase "web_node", dl), dl),
(fn () => (EList (map (fn s => (EString s, dl)) Config.Apache.webNodes_default), dl)))
val _ = Defaults.registerDefault ("WebNodes",
(TList (TBase "web_node", dl), dl),
(fn () => (EList (map (fn s => (EString s, dl)) Config.Apache.webNodes_default), dl)))
@@
-272,6
+272,7
@@
fun write' s = app (fn (node, file) => TextIO.output (file, s node)) (!vhostFile
fun write s = app (fn (_, file) => TextIO.output (file, s)) (!vhostFiles)
val rewriteEnabled = ref false
fun write s = app (fn (_, file) => TextIO.output (file, s)) (!vhostFiles)
val rewriteEnabled = ref false
+val localRewriteEnabled = ref false
val currentVhost = ref ""
val currentVhostId = ref ""
val currentVhost = ref ""
val currentVhostId = ref ""
@@
-319,6
+320,7
@@
val () = Env.containerV_one "vhost"
currentVhostId := vhostId;
rewriteEnabled := false;
currentVhostId := vhostId;
rewriteEnabled := false;
+ localRewriteEnabled := false;
vhostFiles := map (fn node =>
let
val file = Domain.domainFile {node = node,
vhostFiles := map (fn node =>
let
val file = Domain.domainFile {node = node,
@@
-370,24
+372,38
@@
val () = Env.containerV_one "vhost"
write "</VirtualHost>\n";
app (TextIO.closeOut o #2) (!vhostFiles)))
write "</VirtualHost>\n";
app (TextIO.closeOut o #2) (!vhostFiles)))
+val inLocal = ref false
+
val () = Env.container_one "location"
("prefix", Env.string)
(fn prefix =>
(write "\t<Location ";
write prefix;
val () = Env.container_one "location"
("prefix", Env.string)
(fn prefix =>
(write "\t<Location ";
write prefix;
- write ">\n"),
- fn () => write "\t</Location>\n")
+ write ">\n";
+ inLocal := true),
+ fn () => (write "\t</Location>\n";
+ inLocal := false;
+ localRewriteEnabled := false))
val () = Env.container_one "directory"
("directory", Env.string)
(fn directory =>
(write "\t<Directory ";
write directory;
val () = Env.container_one "directory"
("directory", Env.string)
(fn directory =>
(write "\t<Directory ";
write directory;
- write ">\n"),
- fn () => write "\t</Directory>\n")
+ write ">\n";
+ inLocal := true),
+ fn () => (write "\t</Directory>\n";
+ inLocal := false;
+ localRewriteEnabled := false))
fun checkRewrite () =
fun checkRewrite () =
- if !rewriteEnabled then
+ if !inLocal then
+ if !rewriteEnabled orelse !localRewriteEnabled then
+ ()
+ else
+ (write "\tRewriteEngine on\n";
+ localRewriteEnabled := true)
+ else if !rewriteEnabled then
()
else
(write "\tRewriteEngine on\n";
()
else
(write "\tRewriteEngine on\n";