From: Clinton Ebadi Date: Tue, 31 Jan 2017 05:46:25 +0000 (-0500) Subject: apache: Implement fastcgi alias support X-Git-Tag: release_20170131 X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/commitdiff_plain/8c1de2aeb3c00e4ed5e802da2dacddcd686f41e4 apache: Implement fastcgi alias support New directive `fastScriptAlias from to' works like `scriptAlias' but using mod_fcgid. --- diff --git a/lib/apache_alias.dtl b/lib/apache_alias.dtl index f403f21..2263b48 100644 --- a/lib/apache_alias.dtl +++ b/lib/apache_alias.dtl @@ -6,6 +6,12 @@ extern val alias : location -> readable_path -> [Vhost]; extern val scriptAlias : location -> your_path -> [Vhost]; {{Like alias, for Apache's ScriptAlias}} +extern val fastScriptAlias : location -> your_path -> [Vhost]; +{{Like scriptAlias, 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.}} diff --git a/src/plugins/apache.sml b/src/plugins/apache.sml index 8f8b00b..f88fb35 100644 --- a/src/plugins/apache.sml +++ b/src/plugins/apache.sml @@ -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\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")) + val () = Env.action_two "errorDocument" ("code", Env.string, "handler", Env.string) (fn (code, handler) =>