apache: Implement fastcgi alias support release_20170131
authorClinton Ebadi <clinton@unknownlamer.org>
Tue, 31 Jan 2017 05:46:25 +0000 (00:46 -0500)
committerClinton Ebadi <clinton@unknownlamer.org>
Tue, 31 Jan 2017 05:55:40 +0000 (00:55 -0500)
New directive `fastScriptAlias from to' works like `scriptAlias' but
using mod_fcgid.

lib/apache_alias.dtl
src/plugins/apache.sml

index f403f21..2263b48 100644 (file)
@@ -6,6 +6,12 @@ extern val alias : location -> readable_path -> [Vhost];
 extern val scriptAlias : location -> your_path -> [Vhost];
 {{Like <tt>alias</tt>, for Apache's <tt>ScriptAlias</tt>}}
 
+extern val fastScriptAlias : location -> your_path -> [Vhost];
+{{Like <tt>scriptAlias</tt>, but instead sets the location to be
+served by a single-threaded fastcgi program. Apache will manage
+processes so the script must be able to cope with several instances
+running.}}
+
 extern val errorDocument : no_spaces -> no_newlines -> [^Vhost];
 {{The first argument specifies an HTTP error code, which should be handled using
   the second argument, which is either a URL or a string to display.}}
index 8f8b00b..f88fb35 100644 (file)
@@ -787,6 +787,25 @@ val () = Env.action_two "scriptAlias"
              write to;
              write "\n"))
 
+val () = Env.action_two "fastScriptAlias"
+        ("from", Env.string, "to", Env.string)
+        (fn (from, to) =>
+            (write "\tAlias\t";
+             write from;
+             write " ";
+             write to;
+             write "\n";
+
+             write "\t<Location ";
+             write from;
+             write ">\n";
+             write "\t\tSetHandler fcgid-script\n";
+             (* FIXME: only set kerberos wrapper of waklog is on *)
+             write "\t\tFcgidWrapper \"";
+             write (Config.Apache.fastCgiWrapperOf (Domain.getUser ()));
+             write "\"\n";
+             write "\t</Location>"))
+
 val () = Env.action_two "errorDocument"
         ("code", Env.string, "handler", Env.string)
         (fn (code, handler) =>