Apache directory options
authorAdam Chlipala <adamc@hcoop.net>
Mon, 7 Aug 2006 02:53:28 +0000 (02:53 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Mon, 7 Aug 2006 02:53:28 +0000 (02:53 +0000)
lib/apache_options.dtl [new file with mode: 0644]
src/plugins/apache.sml
tests/testApache.dtl

diff --git a/lib/apache_options.dtl b/lib/apache_options.dtl
new file mode 100644 (file)
index 0000000..072e3f8
--- /dev/null
@@ -0,0 +1,17 @@
+{{Per-directory options for Apache}}
+
+extern type apache_option;
+{{See <a href="http://httpd.apache.org/docs/2.0/mod/core.html#options">the
+  Apache documentation</a> for what the options mean.}}
+
+extern val execCGI : apache_option;
+extern val includesNOEXEC : apache_option;
+extern val indexes : apache_option;
+
+extern val options : [apache_option] -> [^Vhost];
+{{Declare exactly the set of options in effect for the current scope.}}
+
+extern val set_options : [apache_option] -> [^Vhost];
+extern val unset_options : [apache_option] -> [^Vhost];
+{{Specify some options to be set or unset, leaving the rest as they are.}}
+
index 4ea8f22..f497825 100644 (file)
@@ -126,6 +126,11 @@ val cond_flag = fn (EVar "cond_nocase", _) => SOME "NC"
            | (EVar "ornext", _) => SOME "OR"
            | _ => NONE
 
            | (EVar "ornext", _) => SOME "OR"
            | _ => NONE
 
+val apache_option = fn (EVar "execCGI", _) => SOME "ExecCGI"
+                    | (EVar "includesNOEXEC", _) => SOME "IncludesNOEXEC"
+                    | (EVar "indexes", _) => SOME "Indexes"
+                    | _ => NONE
+
 
 val vhostsChanged = ref false
 
 
 val vhostsChanged = ref false
 
@@ -330,5 +335,31 @@ val () = Env.action_two "errorDocument"
              write handler;
              write "\n"))
 
              write handler;
              write "\n"))
 
+val () = Env.action_one "options"
+        ("options", Env.list apache_option)
+        (fn opts =>
+            case opts of
+                [] => ()
+              | _ => (write "\tOptions";
+                      app (fn opt => (write " "; write opt)) opts;
+                      write "\n"))
+
+val () = Env.action_one "set_options"
+        ("options", Env.list apache_option)
+        (fn opts =>
+            case opts of
+                [] => ()
+              | _ => (write "\tOptions";
+                      app (fn opt => (write " +"; write opt)) opts;
+                      write "\n"))
+
+val () = Env.action_one "unset_options"
+        ("options", Env.list apache_option)
+        (fn opts =>
+            case opts of
+                [] => ()
+              | _ => (write "\tOptions";
+                      app (fn opt => (write " -"; write opt)) opts;
+                      write "\n"))
 
 end
 
 end
index c8438ff..ff45dfa 100644 (file)
@@ -25,11 +25,15 @@ domain "hcoop.net" with
                proxyPass "/proxyLand" "http://localhost:1234/otherProxyLand";
                proxyPassReverse "/proxyLand" "http://localhost:1234/otherProxyLand";
 
                proxyPass "/proxyLand" "http://localhost:1234/otherProxyLand";
                proxyPassReverse "/proxyLand" "http://localhost:1234/otherProxyLand";
 
+               options [execCGI];
+               set_options [execCGI, indexes];
+
                scriptAlias "/cgi-bin/that-script" "/home/adamc/cgi/here-it-is";
                errorDocument "404" "I just couldn't find it.";
 
                directory "/home/adamc/thisPlace" with
                        rewriteRule "A" "B" [];
                scriptAlias "/cgi-bin/that-script" "/home/adamc/cgi/here-it-is";
                errorDocument "404" "I just couldn't find it.";
 
                directory "/home/adamc/thisPlace" with
                        rewriteRule "A" "B" [];
+                       unset_options [includesNOEXEC];
                end
        end;
 
                end
        end;