X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/ebf47697644deafd0bde2dfb207b0048a8f2753c..81180509ead024b0b46beb4a356bf8d7887b5d51:/src/plugins/apache.sml diff --git a/src/plugins/apache.sml b/src/plugins/apache.sml index 6de4f1b..c97b9a3 100644 --- a/src/plugins/apache.sml +++ b/src/plugins/apache.sml @@ -533,10 +533,14 @@ fun vhostBody (env, makeFullHost) = TextIO.output (file, user); TextIO.output (file, " "); TextIO.output (file, group); - TextIO.output (file, "\n\tsuPHP_UserGroup "); - TextIO.output (file, user); - TextIO.output (file, " "); - TextIO.output (file, group)) + (* suPHP is no longer used for fastcgi php and php 7.x *) + (if php < 6 then + (TextIO.output (file, "\n\tsuPHP_UserGroup "); + TextIO.output (file, user); + TextIO.output (file, " "); + TextIO.output (file, group)) + else + ())) else (); @@ -790,21 +794,37 @@ val () = Env.action_two "scriptAlias" val () = Env.action_two "fastScriptAlias" ("from", Env.string, "to", Env.string) (fn (from, to) => - (write "\tAlias\t"; - write from; - write " "; - write to; - write "\n"; + let + (* mod_fcgid + kerberos limit this to working with + individual fcgi programs. assume the target path is a + file and any trailing `/' is just aliasing + syntax. Directory+File on the script is used to + activate fcgid instead of Location on the alias to + limit effects (alias+location also match in inverse + order causing pernicious side-effects *) + val fcgi_path = if String.sub (to, size to - 1) = #"/" + then + String.substring (to, 0, size to - 1) + else + to + val fcgi_dir = OS.Path.dir fcgi_path + val fcgi_file = OS.Path.file fcgi_path + in + 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\n")) + write "\t\n"; + write "\t\n"; + write "\tSetHandler fcgid-script\n"; + + (* FIXME: only set kerberos wrapper of waklog is on *) + write "\tFcgidWrapper \""; + write (Config.Apache.fastCgiWrapperOf (Domain.getUser ())); + write " "; + write fcgi_path; + write "\"\n"; + + write "\t\n\t\n" + end) val () = Env.action_two "errorDocument" ("code", Env.string, "handler", Env.string)