Change default web hostname
authorAdam Chlipala <adamc@hcoop.net>
Thu, 6 Oct 2005 03:36:19 +0000 (03:36 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Thu, 6 Oct 2005 03:36:19 +0000 (03:36 +0000)
src/apache/apache.sml

index 3350009..fb3de8d 100644 (file)
@@ -302,11 +302,27 @@ struct
                                        "\t\tOrder Deny,Allow\n" ^
                                        "\t\tDeny from all\n" ^
                                        "\t\tAllow from 127.0.0.1\n" ^
-                                       (*"\t\tAllow from 63.246.10.45\n" ^*)
                                        "\t\tSatisfy any\n" ^
                                        "\t</Location>\n")
                     else
                         Domtool.error (path, "HcoopPrivate only allowed for SSL vhosts")
+                  | ["HcoopPrivate", p] =>
+                    if not (checkPath (paths, p)) then
+                        Domtool.error (path, "not authorized to use " ^ p)
+                    else if ssl then
+                        TextIO.output (vhosts,
+                                       "\t<Directory " ^ p ^ ">\n" ^
+                                       "\t\tAuthName \"hcoop web account\"\n" ^
+                                       "\t\tAuthType basic\n" ^
+                                       "\t\tAuthUserFile " ^ passwdFile ^ "\n" ^
+                                       "\t\tRequire valid-user\n" ^
+                                       "\t\tOrder Deny,Allow\n" ^
+                                       "\t\tDeny from all\n" ^
+                                       "\t\tAllow from 127.0.0.1\n" ^
+                                       "\t\tSatisfy any\n" ^
+                                       "\t</Directory>\n")
+                    else
+                        Domtool.error (path, "HcoopPrivate only allowed for SSL vhosts")
                   | ["Block", pat] => blocked := pat :: (!blocked)
                   | ["Default"] => (TextIO.output (vhosts, "\tServerAlias " ^ parent ^ "\n");
                                     TextIO.output (conf, "HideSite\t" ^ parent ^ "\n" ^