apache: move davlockdb to /var/local
[hcoop/domtool2.git] / src / plugins / apache.sml
index 20bd7ed..9d751e8 100644 (file)
@@ -473,7 +473,9 @@ fun vhostPost () = (!post ();
 
 val php_version = fn (EVar "php56", _) => SOME 56
                    | (EVar "php72", _) => SOME 72
-                   | _ => NONE
+                  | (EVar "php73", _) => SOME 73
+                  | (EVar "php74", _) => SOME 74
+                  | _ => NONE
 
 fun vhostBody (env, makeFullHost) =
     let
@@ -559,7 +561,7 @@ fun vhostBody (env, makeFullHost) =
                                  else
                                      ();
 
-                                 TextIO.output (file, "\n\tDAVLockDB /var/lock/apache2/dav/");
+                                 TextIO.output (file, "\n\tDAVLockDB /var/local/domtool/apache2/dav/");
                                  TextIO.output (file, user);
                                  TextIO.output (file, "/DAVLock");
 
@@ -663,17 +665,26 @@ fun checkExpires () =
        (write "\tExpiresActive on\n";
         expiresEnabled := true)
 
-val () = Env.action_three "localProxyRewrite"
-        ("from", Env.string, "to", Env.string, "port", Env.int)
-        (fn (from, to, port) =>
+val () = Env.action_four "proxyRewrite"
+        ("from", Env.string, "to", Env.string, "tohost", Env.string, "flags", Env.list flag)
+        (fn (from, to, tohost, flags) =>
             (checkRewrite ();
              write "\tRewriteRule\t\"";
              write from;
-             write "\"\thttp://localhost:";
-             write (Int.toString port);
-             write "/";
+             write "\"\t\"";
+             write tohost;
+             write "/"; (* ensure rewrite rule can't change port *)
              write to;
-             write " [P]\n"))
+             write "\"";
+             write " [P";
+             case flags of
+                 [] => ()
+               | flag::rest => (write ",";
+                                write flag;
+                                app (fn flag => (write ",";
+                                                 write flag)) rest);
+
+             write "]\n"))
 
 val () = Env.action_four "expiresByType"
         ("mime", Env.string, "base", interval_base, "num", Env.int, "inter", interval)
@@ -762,15 +773,20 @@ val () = Env.action_one "rewriteBase"
              write prefix;
              write "\"\n"))
 
+val _ = Env.type_one "mod_rewrite_trace_level"
+       Env.int
+       (fn n => n > 0 andalso n <= 8)
+
 val () = Env.action_one "rewriteLogLevel"
         ("level", Env.int)
-        (fn level =>
+        (fn 0 =>
             (checkRewrite ();
-             write "\tRewriteLog ";
-             write' (fn x => x);
-             write "/rewrite.log\n\tRewriteLogLevel ";
-             write (Int.toString level);
-             write "\n"))
+             write "\tLogLevel rewrite:warn\n")
+        | level =>
+          (checkRewrite ();
+           write "\tLogLevel rewrite:trace";
+           write (Int.toString level);
+           write "\n"))
 
 val () = Env.action_two "alias"
         ("from", Env.string, "to", Env.string)