- TextIO.output (file, "\n<VirtualHost ");
- TextIO.output (file, Domain.nodeIp node);
- TextIO.output (file, ":");
- TextIO.output (file, case ssl of
- SOME _ => "443"
- | NONE => "80");
- TextIO.output (file, ">\n");
- TextIO.output (file, "\tErrorLog ");
- TextIO.output (file, ld);
- TextIO.output (file, "/error.log\n\tCustomLog ");
- TextIO.output (file, ld);
- TextIO.output (file, "/access.log combined\n");
- TextIO.output (file, "\tServerName ");
- TextIO.output (file, fullHost);
- app
- (fn dom => (TextIO.output (file, "\n\tServerAlias ");
- TextIO.output (file, host);
- TextIO.output (file, ".");
- TextIO.output (file, dom)))
- (Domain.currentAliasDomains ());
- if suexec then
- if isVersion1 node then
- (TextIO.output (file, "\n\tUser ");
- TextIO.output (file, user);
- TextIO.output (file, "\n\tGroup ");
- TextIO.output (file, group))
- else
- (TextIO.output (file, "\n\tSuexecUserGroup ");
- TextIO.output (file, user);
- TextIO.output (file, " ");
- TextIO.output (file, group))
- else
- ();
- if isWaklog node then
- (TextIO.output (file, "\n\tWaklogEnabled on\n\tWaklogLocationPrincipal ");
- TextIO.output (file, user);
- TextIO.output (file, "/daemon@HCOOP.NET /etc/keytabs/user.daemon/");
- TextIO.output (file, user))
- else
- ();
- (ld, file)
- end)
- nodes;
- write "\n\tDocumentRoot ";
- write docroot;
- write "\n\tServerAdmin ";
- write sadmin;
- case ssl of
- SOME cert =>
- (write "\n\tSSLEngine on\n\tSSLCertificateFile ";
- write cert)
- | NONE => ();
- write "\n";
- !pre {user = user, nodes = nodes, id = vhostId, hostname = fullHost};
- app (fn dom => !aliaser (host ^ "." ^ dom)) (Domain.currentAliasDomains ())
- end,
- fn () => (!post ();
- write "</VirtualHost>\n";
- app (TextIO.closeOut o #2) (!vhostFiles)))
+ TextIO.output (file, "\n\tGroup ");
+ TextIO.output (file, group))
+ else
+ (TextIO.output (file, "\n\tSuexecUserGroup ");
+ 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))
+ else
+ ();
+
+ if isWaklog node then
+ (TextIO.output (file, "\n\tWaklogEnabled on\n\tWaklogLocationPrincipal ");
+ TextIO.output (file, user);
+ TextIO.output (file, "/daemon@HCOOP.NET /etc/keytabs/user.daemon/");
+ TextIO.output (file, user))
+ else
+ ();
+
+ TextIO.output (file, "\n\tDAVLockDB /var/lock/apache2/dav/");
+ TextIO.output (file, user);
+ TextIO.output (file, "/DAVLock");
+
+ if php = Config.Apache.defaultPhpVersion
+ then
+ ()
+ else if php = 6
+ then
+ (* fastcgi php 5.6 since 6 doesn't exist *)
+ (TextIO.output (file, "\n\tAddHandler fcgid-script .php .phtml");
+ (* FIXME: only set kerberos wrapper of waklog is on *)
+ map (fn ext => (TextIO.output (file, "\n\tFcgidWrapper \"");
+ TextIO.output (file, Config.Apache.fastCgiWrapperOf user);
+ TextIO.output (file, " ");
+ TextIO.output (file, Config.Apache.phpFastCgiWrapper);
+ TextIO.output (file, "\" ");
+ TextIO.output (file, ext)))
+ [".php", ".phtml"];
+ ())
+ else
+ (TextIO.output (file, "\n\tAddHandler x-httpd-php");
+ TextIO.output (file, Int.toString php);
+ TextIO.output (file, " .php .phtml"));
+ (ld, file)
+ end)
+ places;
+ write "\n\tDocumentRoot ";
+ write docroot;
+ write "\n\tServerAdmin ";
+ write sadmin;
+ case ssl of
+ SOME cert =>
+ (write "\n\tSSLEngine on\n\tSSLCertificateFile ";
+ write cert)
+ | NONE => ();
+ write "\n";
+ !pre {user = user, nodes = map #1 places, id = vhostId, hostname = fullHost};
+ app (fn dom => !aliaser (makeFullHost dom)) (Domain.currentAliasDomains ())
+ end
+
+val () = Env.containerV_one "vhost"
+ ("host", Env.string)
+ (fn (env, host) => vhostBody (env, fn dom => host ^ "." ^ dom),
+ vhostPost)
+
+val () = Env.containerV_none "vhostDefault"
+ (fn env => vhostBody (env, fn dom => dom),
+ vhostPost)