1 (* HCoop
Domtool (http
://hcoop
.sourceforge
.net
/)
2 * Copyright (c
) 2006-2007, Adam Chlipala
4 * This program is free software
; you can redistribute it
and/or
5 * modify it under the terms
of the GNU General Public License
6 * as published by the Free Software Foundation
; either version
2
7 * of the License
, or (at your option
) any later version
.
9 * This program is distributed
in the hope that it will be useful
,
10 * but WITHOUT ANY WARRANTY
; without even the implied warranty
of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
. See the
12 * GNU General Public License for more details
.
14 * You should have received a copy
of the GNU General Public License
15 * along
with this program
; if not
, write to the Free Software
16 * Foundation
, Inc
., 51 Franklin Street
, Fifth Floor
, Boston
, MA
02110-1301, USA
.
19 (* Apache HTTPD handling
*)
21 structure Apache
:> APACHE
= struct
25 val _
= Env
.type_one
"web_node"
28 List.exists (fn (x
, _
) => x
= node
) Config
.Apache
.webNodes_all
29 orelse (Domain
.hasPriv
"www"
30 andalso List.exists (fn (x
, _
) => x
= node
) Config
.Apache
.webNodes_admin
))
32 val _
= Env
.registerFunction ("web_node_to_node",
36 val _
= Env
.type_one
"proxy_port"
40 val _
= Env
.type_one
"proxy_target"
44 fun default () = List.exists (fn s
' => s
= s
') Config
.Apache
.proxyTargets
46 case String.fields (fn ch
=> ch
= #
":") s
of
47 ["http", "//localhost", rest
] =>
48 (case String.fields (fn ch
=> ch
= #
"/") rest
of
50 (case Int.fromString port
of
52 | SOME n
=> n
> 1024 orelse default ())
57 val _
= Env
.type_one
"rewrite_arg"
59 (CharVector
.all
Char.isAlphaNum
)
61 val _
= Env
.type_one
"suexec_flag"
63 (fn b
=> b
orelse Domain
.hasPriv
"www")
66 size s
> 0 andalso size s
< 1000 andalso CharVector
.all
67 (fn ch
=> Char.isAlphaNum ch
73 val _
= Env
.type_one
"location"
77 fun validCert s
= Acl
.query
{user
= Domain
.getUser (),
81 val _
= Env
.type_one
"ssl_cert_path"
86 (EVar
"no_ssl", _
) => SOME NONE
87 |
(EApp ((EVar
"use_cert", _
), s
), _
) => Option
.map
SOME (Env
.string s
)
90 val dl
= ErrorMsg
.dummyLoc
92 val defaults
= [("WebNodes",
93 (TList (TBase
"web_node", dl
), dl
),
94 (fn () => (EList (map (fn s
=> (EString s
, dl
)) Config
.Apache
.webNodes_default
), dl
))),
97 (fn () => (EVar
"no_ssl", dl
))),
99 (TBase
"your_user", dl
),
100 (fn () => (EString (Domain
.getUser ()), dl
))),
102 (TBase
"your_group", dl
),
103 (fn () => (EString
"nogroup", dl
))),
105 (TBase
"your_path", dl
),
106 (fn () => (EString (Domain
.homedir () ^
"/" ^ Config
.Apache
.public_html
), dl
))),
109 (fn () => (EString (Domain
.getUser () ^
"@" ^ Config
.defaultDomain
), dl
))),
111 (TBase
"suexec_flag", dl
),
112 (fn () => (EVar
"true", dl
)))]
114 val () = app Defaults
.registerDefault defaults
116 val redirect_code
= fn (EVar
"temp", _
) => SOME
"temp"
117 |
(EVar
"permanent", _
) => SOME
"permanent"
118 |
(EVar
"seeother", _
) => SOME
"seeother"
119 |
(EVar
"redir300", _
) => SOME
"300"
120 |
(EVar
"redir301", _
) => SOME
"301"
121 |
(EVar
"redir302", _
) => SOME
"302"
122 |
(EVar
"redir303", _
) => SOME
"303"
123 |
(EVar
"redir304", _
) => SOME
"304"
124 |
(EVar
"redir305", _
) => SOME
"305"
125 |
(EVar
"redir307", _
) => SOME
"307"
128 val flag
= fn (EVar
"redirect", _
) => SOME
"R"
129 |
(EVar
"forbidden", _
) => SOME
"F"
130 |
(EVar
"gone", _
) => SOME
"G"
131 |
(EVar
"last", _
) => SOME
"L"
132 |
(EVar
"chain", _
) => SOME
"C"
133 |
(EVar
"nosubreq", _
) => SOME
"NS"
134 |
(EVar
"nocase", _
) => SOME
"NC"
135 |
(EVar
"qsappend", _
) => SOME
"QSA"
136 |
(EVar
"noescape", _
) => SOME
"NE"
137 |
(EVar
"passthrough", _
) => SOME
"PT"
138 |
(EApp ((EVar
"mimeType", _
), e
), _
) =>
139 Option
.map (fn s
=> "T=" ^ s
) (Env
.string e
)
140 |
(EApp ((EVar
"redirectWith", _
), e
), _
) =>
141 Option
.map (fn s
=> "R=" ^ s
) (redirect_code e
)
142 |
(EApp ((EVar
"skip", _
), e
), _
) =>
143 Option
.map (fn n
=> "S=" ^
Int.toString n
) (Env
.int e
)
144 |
(EApp ((EApp ((EVar
"env", _
), e1
), _
), e2
), _
) =>
145 (case Env
.string e1
of
147 | SOME s1
=> Option
.map (fn s2
=> "E=" ^ s1 ^
":" ^ s2
)
152 val cond_flag
= fn (EVar
"cond_nocase", _
) => SOME
"NC"
153 |
(EVar
"ornext", _
) => SOME
"OR"
156 val apache_option
= fn (EVar
"execCGI", _
) => SOME
"ExecCGI"
157 |
(EVar
"includesNOEXEC", _
) => SOME
"IncludesNOEXEC"
158 |
(EVar
"indexes", _
) => SOME
"Indexes"
161 val autoindex_width
= fn (EVar
"autofit", _
) => SOME
"*"
162 |
(EApp ((EVar
"characters", _
), n
), _
) =>
163 Option
.map
Int.toString (Env
.int n
)
166 val autoindex_option
= fn (EApp ((EVar
"descriptionWidth", _
), w
), _
) =>
167 Option
.map (fn w
=> ("DescriptionWidth", SOME w
))
169 |
(EVar
"fancyIndexing", _
) => SOME ("FancyIndexing", NONE
)
170 |
(EVar
"foldersFirst", _
) => SOME ("FoldersFirst", NONE
)
171 |
(EVar
"htmlTable", _
) => SOME ("HTMLTable", NONE
)
172 |
(EVar
"iconsAreLinks", _
) => SOME ("IconsAreLinks", NONE
)
173 |
(EApp ((EVar
"iconHeight", _
), n
), _
) =>
174 Option
.map (fn w
=> ("IconHeight", SOME (Int.toString w
)))
176 |
(EApp ((EVar
"iconWidth", _
), n
), _
) =>
177 Option
.map (fn w
=> ("IconWidth", SOME (Int.toString w
)))
179 |
(EVar
"ignoreCase", _
) => SOME ("IgnoreCase", NONE
)
180 |
(EVar
"ignoreClient", _
) => SOME ("IgnoreClient", NONE
)
181 |
(EApp ((EVar
"nameWidth", _
), w
), _
) =>
182 Option
.map (fn w
=> ("NameWidth", SOME w
))
184 |
(EVar
"scanHtmlTitles", _
) => SOME ("ScanHTMLTitles", NONE
)
185 |
(EVar
"suppressColumnSorting", _
) => SOME ("SuppressColumnSorting", NONE
)
186 |
(EVar
"suppressDescription", _
) => SOME ("SuppressDescription", NONE
)
187 |
(EVar
"suppressHtmlPreamble", _
) => SOME ("SuppressHTMLPreamble", NONE
)
188 |
(EVar
"suppressIcon", _
) => SOME ("SuppressIcon", NONE
)
189 |
(EVar
"suppressLastModified", _
) => SOME ("SuppressLastModified", NONE
)
190 |
(EVar
"suppressRules", _
) => SOME ("SuppressRules", NONE
)
191 |
(EVar
"suppressSize", _
) => SOME ("SuppressSize", NONE
)
192 |
(EVar
"trackModified", _
) => SOME ("TrackModified", NONE
)
193 |
(EVar
"versionSort", _
) => SOME ("VersionSort", NONE
)
194 |
(EVar
"xhtml", _
) => SOME ("XHTML", NONE
)
198 val vhostsChanged
= ref
false
199 val logDeleted
= ref
false
201 val () = Slave
.registerPreHandler
202 (fn () => (vhostsChanged
:= false;
203 logDeleted
:= false))
205 fun findVhostUser fname
=
207 val inf
= TextIO.openIn fname
210 case TextIO.inputLine inf
of
213 if String.isPrefix
"# Owner: " line
then
214 case String.tokens
Char.isSpace line
of
215 [_
, _
, user
] => SOME user
221 before TextIO.closeIn inf
224 val webNodes_full
= Config
.Apache
.webNodes_all @ Config
.Apache
.webNodes_admin
226 fun isVersion1 node
=
227 List.exists (fn (n
, {version
= ConfigTypes
.APACHE_1_3
, ...}) => n
= node
228 | _
=> false) webNodes_full
230 fun imVersion1 () = isVersion1 (Slave
.hostname ())
233 List.exists (fn (n
, {auth
= ConfigTypes
.MOD_WAKLOG
, ...}) => n
= node
234 | _
=> false) webNodes_full
236 fun down () = if imVersion1 () then Config
.Apache
.down1
else Config
.Apache
.down
237 fun undown () = if imVersion1 () then Config
.Apache
.undown1
else Config
.Apache
.undown
238 fun reload () = if imVersion1 () then Config
.Apache
.reload1
else Config
.Apache
.reload
240 fun logDir
{user
, node
, vhostId
} =
241 String.concat
[Config
.Apache
.logDirOf (isVersion1 node
) user
,
247 val () = Slave
.registerFileHandler (fn fs
=>
249 val spl
= OS
.Path
.splitDirFile (#file fs
)
251 if String.isSuffix
".vhost" (#file spl
)
252 orelse String.isSuffix
".vhost_ssl" (#file spl
) then let
253 val realVhostFile
= OS
.Path
.joinDirFile
254 {dir
= Config
.Apache
.confDir
,
257 val user
= findVhostUser (#file fs
)
258 val oldUser
= findVhostUser realVhostFile
260 if (oldUser
= NONE
andalso #action fs
<> Slave
.Add
)
261 orelse (user
= NONE
andalso #action fs
<> Slave
.Delete
) then
262 print ("Can't find user in " ^ #file fs ^
" or " ^ realVhostFile ^
"! Taking no action.\n")
265 val vhostId
= if OS
.Path
.ext (#file spl
) = SOME
"vhost_ssl" then
266 OS
.Path
.base (#file spl
) ^
".ssl"
268 OS
.Path
.base (#file spl
)
270 fun realLogDir user
=
271 logDir
{user
= valOf user
,
272 node
= Slave
.hostname (),
275 vhostsChanged
:= true;
281 (ignore (OS
.Process
.system (down ()));
283 ignore (OS
.Process
.system (Config
.rm
286 ignore (OS
.Process
.system (Config
.rm
288 ^ realLogDir oldUser
)))
291 val rld
= realLogDir user
293 ignore (OS
.Process
.system (Config
.cp
298 if Posix
.FileSys
.access (rld
, []) then
305 (ignore (OS
.Process
.system (Config
.cp
310 if user
<> oldUser
then
312 val old
= realLogDir oldUser
313 val rld
= realLogDir user
318 (ignore (OS
.Process
.system (down ()));
320 ignore (OS
.Process
.system (Config
.rm
322 ^ realLogDir oldUser
));
323 if Posix
.FileSys
.access (rld
, []) then
336 val () = Slave
.registerPostHandler
338 (if !vhostsChanged
then
339 Slave
.shellF ([if !logDeleted
then undown () else reload ()],
340 fn cl
=> "Error reloading Apache with " ^ cl
)
344 val vhostFiles
: (string * TextIO.outstream
) list ref
= ref
[]
345 fun write
' s
= app (fn (node
, file
) => TextIO.output (file
, s node
)) (!vhostFiles
)
346 fun write s
= app (fn (_
, file
) => TextIO.output (file
, s
)) (!vhostFiles
)
348 val rewriteEnabled
= ref
false
349 val localRewriteEnabled
= ref
false
350 val currentVhost
= ref
""
351 val currentVhostId
= ref
""
352 val sslEnabled
= ref
false
354 val pre
= ref (fn _
: {user
: string, nodes
: string list
, id
: string, hostname
: string} => ())
359 pre
:= (fn x
=> (old x
; f x
))
362 val post
= ref (fn () => ())
367 post
:= (fn () => (old (); f ()))
370 val aliaser
= ref (fn _
: string => ())
371 fun registerAliaser f
=
375 aliaser
:= (fn x
=> (old x
; f x
))
378 val () = Env
.containerV_one
"vhost"
382 val nodes
= Env
.env (Env
.list Env
.string) (env
, "WebNodes")
384 val ssl
= Env
.env
ssl (env
, "SSL")
385 val user
= Env
.env Env
.string (env
, "User")
386 val group
= Env
.env Env
.string (env
, "Group")
387 val docroot
= Env
.env Env
.string (env
, "DocumentRoot")
388 val sadmin
= Env
.env Env
.string (env
, "ServerAdmin")
389 val suexec
= Env
.env Env
.bool (env
, "SuExec")
391 val fullHost
= host ^
"." ^ Domain
.currentDomain ()
392 val vhostId
= fullHost ^
(if Option
.isSome ssl
then ".ssl" else "")
393 val confFile
= fullHost ^
(if Option
.isSome ssl
then ".vhost_ssl" else ".vhost")
395 currentVhost
:= fullHost
;
396 currentVhostId
:= vhostId
;
397 sslEnabled
:= Option
.isSome ssl
;
399 rewriteEnabled
:= false;
400 localRewriteEnabled
:= false;
401 vhostFiles
:= map (fn node
=>
403 val file
= Domain
.domainFile
{node
= node
,
406 val ld
= logDir
{user
= user
, node
= node
, vhostId
= vhostId
}
408 TextIO.output (file
, "# Owner: ");
409 TextIO.output (file
, user
);
410 TextIO.output (file
, "\n<VirtualHost ");
411 TextIO.output (file
, Domain
.nodeIp node
);
412 TextIO.output (file
, ":");
413 TextIO.output (file
, case ssl
of
416 TextIO.output (file
, ">\n");
417 TextIO.output (file
, "\tErrorLog ");
418 TextIO.output (file
, ld
);
419 TextIO.output (file
, "/error.log\n\tCustomLog ");
420 TextIO.output (file
, ld
);
421 TextIO.output (file
, "/access.log combined\n");
422 TextIO.output (file
, "\tServerName ");
423 TextIO.output (file
, fullHost
);
425 (fn dom
=> (TextIO.output (file
, "\n\tServerAlias ");
426 TextIO.output (file
, host
);
427 TextIO.output (file
, ".");
428 TextIO.output (file
, dom
)))
429 (Domain
.currentAliasDomains ());
432 if isVersion1 node
then
433 (TextIO.output (file
, "\n\tUser ");
434 TextIO.output (file
, user
);
435 TextIO.output (file
, "\n\tGroup ");
436 TextIO.output (file
, group
))
438 (TextIO.output (file
, "\n\tSuexecUserGroup ");
439 TextIO.output (file
, user
);
440 TextIO.output (file
, " ");
441 TextIO.output (file
, group
))
445 if isWaklog node
then
446 (TextIO.output (file
, "\n\tWaklogEnabled on\n\tWaklogLocationPrincipal ");
447 TextIO.output (file
, user
);
448 TextIO.output (file
, "/daemon@HCOOP.NET /etc/keytabs/user.daemon/");
449 TextIO.output (file
, user
))
453 TextIO.output (file
, "\n\tDAVLockDB /var/lock/apache2/dav/");
454 TextIO.output (file
, user
);
455 TextIO.output (file
, "/DAVLock");
460 write
"\n\tDocumentRoot ";
462 write
"\n\tServerAdmin ";
466 (write
"\n\tSSLEngine on\n\tSSLCertificateFile ";
470 !pre
{user
= user
, nodes
= nodes
, id
= vhostId
, hostname
= fullHost
};
471 app (fn dom
=> !aliaser (host ^
"." ^ dom
)) (Domain
.currentAliasDomains ())
474 write
"</VirtualHost>\n";
475 app (TextIO.closeOut
o #
2) (!vhostFiles
)))
477 val inLocal
= ref
false
479 val () = Env
.container_one
"location"
480 ("prefix", Env
.string)
482 (write
"\t<Location ";
486 fn () => (write
"\t</Location>\n";
488 localRewriteEnabled
:= false))
490 val () = Env
.container_one
"directory"
491 ("directory", Env
.string)
493 (write
"\t<Directory ";
497 fn () => (write
"\t</Directory>\n";
499 localRewriteEnabled
:= false))
501 fun checkRewrite () =
503 if !rewriteEnabled
orelse !localRewriteEnabled
then
506 (write
"\tRewriteEngine on\n";
507 localRewriteEnabled
:= true)
508 else if !rewriteEnabled
then
511 (write
"\tRewriteEngine on\n";
512 rewriteEnabled
:= true)
514 val () = Env
.action_three
"localProxyRewrite"
515 ("from", Env
.string, "to", Env
.string, "port", Env
.int)
516 (fn (from
, to
, port
) =>
518 write
"\tRewriteRule\t";
520 write
"\thttp://localhost:";
521 write (Int.toString port
);
526 val () = Env
.action_two
"proxyPass"
527 ("from", Env
.string, "to", Env
.string)
529 (write
"\tProxyPass\t";
535 val () = Env
.action_two
"proxyPassReverse"
536 ("from", Env
.string, "to", Env
.string)
538 (write
"\tProxyPassReverse\t";
544 val () = Env
.action_three
"rewriteRule"
545 ("from", Env
.string, "to", Env
.string, "flags", Env
.list flag
)
546 (fn (from
, to
, flags
) =>
548 write
"\tRewriteRule\t";
554 | flag
::rest
=> (write
" [";
556 app (fn flag
=> (write
",";
561 val () = Env
.action_three
"rewriteCond"
562 ("test", Env
.string, "pattern", Env
.string, "flags", Env
.list cond_flag
)
563 (fn (from
, to
, flags
) =>
565 write
"\tRewriteCond\t";
571 | flag
::rest
=> (write
" [";
573 app (fn flag
=> (write
",";
578 val () = Env
.action_one
"rewriteBase"
579 ("prefix", Env
.string)
582 write
"\tRewriteBase\t";
586 val () = Env
.action_one
"rewriteLogLevel"
590 write
"\tRewriteLog ";
592 write
"/rewrite.log\n\tRewriteLogLevel ";
593 write (Int.toString level
);
596 val () = Env
.action_two
"alias"
597 ("from", Env
.string, "to", Env
.string)
605 val () = Env
.action_two
"scriptAlias"
606 ("from", Env
.string, "to", Env
.string)
608 (write
"\tScriptAlias\t";
614 val () = Env
.action_two
"errorDocument"
615 ("code", Env
.string, "handler", Env
.string)
616 (fn (code
, handler
) =>
617 (write
"\tErrorDocument\t";
623 val () = Env
.action_one
"options"
624 ("options", Env
.list apache_option
)
628 | _
=> (write
"\tOptions";
629 app (fn opt
=> (write
" "; write opt
)) opts
;
632 val () = Env
.action_one
"set_options"
633 ("options", Env
.list apache_option
)
637 | _
=> (write
"\tOptions";
638 app (fn opt
=> (write
" +"; write opt
)) opts
;
641 val () = Env
.action_one
"unset_options"
642 ("options", Env
.list apache_option
)
646 | _
=> (write
"\tOptions";
647 app (fn opt
=> (write
" -"; write opt
)) opts
;
650 val () = Env
.action_one
"directoryIndex"
651 ("filenames", Env
.list Env
.string)
653 (write
"\tDirectoryIndex";
654 app (fn opt
=> (write
" "; write opt
)) opts
;
657 val () = Env
.action_one
"serverAliasHost"
660 (write
"\tServerAlias ";
665 val () = Env
.action_one
"serverAlias"
671 val full
= host ^
"." ^ dom
673 write
"\tServerAlias ";
678 (Domain
.currentDomains ())))
680 val () = Env
.action_none
"serverAliasDefault"
684 (write
"\tServerAlias ";
688 (Domain
.currentDomains ())))
690 val authType
= fn (EVar
"basic", _
) => SOME
"basic"
691 |
(EVar
"digest", _
) => SOME
"digest"
692 |
(EVar
"kerberos", _
) => SOME
"kerberos"
695 fun allowAuthType
"kerberos" = !sslEnabled
696 | allowAuthType _
= true
698 val () = Env
.action_one
"authType"
701 if allowAuthType ty
then
702 (write
"\tAuthType ";
707 write
"\tKrbMethodNegotiate off\n\tKrbMethodK5Passwd on\n\tKrbVerifyKDC off\n\tKrbAuthRealms HCOOP.NET\n\tKrbSaveCredentials on\n"
710 print
"WARNING: Skipped Kerberos authType because this isn't an SSL vhost.\n")
712 val () = Env
.action_one
"authName"
715 (write
"\tAuthName \"";
719 val () = Env
.action_one
"authUserFile"
722 (write
"\tAuthUserFile ";
726 val () = Env
.action_none
"requireValidUser"
727 (fn () => write
"\tRequire valid-user\n")
729 val () = Env
.action_one
"requireUser"
730 ("users", Env
.list Env
.string)
734 | _
=> (write
"\tRequire user";
735 app (fn name
=> (write
" "; write name
)) names
;
738 val () = Env
.action_one
"requireGroup"
739 ("groups", Env
.list Env
.string)
743 | _
=> (write
"\tRequire group";
744 app (fn name
=> (write
" "; write name
)) names
;
747 val () = Env
.action_none
"orderAllowDeny"
748 (fn () => write
"\tOrder allow,deny\n")
750 val () = Env
.action_none
"orderDenyAllow"
751 (fn () => write
"\tOrder deny,allow\n")
753 val () = Env
.action_none
"allowFromAll"
754 (fn () => write
"\tAllow from all\n")
756 val () = Env
.action_one
"allowFrom"
757 ("entries", Env
.list Env
.string)
761 | _
=> (write
"\tAllow from";
762 app (fn name
=> (write
" "; write name
)) names
;
765 val () = Env
.action_none
"denyFromAll"
766 (fn () => write
"\tDeny from all\n")
768 val () = Env
.action_one
"denyFrom"
769 ("entries", Env
.list Env
.string)
773 | _
=> (write
"\tDeny from";
774 app (fn name
=> (write
" "; write name
)) names
;
777 val () = Env
.action_none
"satisfyAll"
778 (fn () => write
"\tSatisfy all\n")
780 val () = Env
.action_none
"satisfyAny"
781 (fn () => write
"\tSatisfy any\n")
783 val () = Env
.action_one
"forceType"
785 (fn ty
=> (write
"\tForceType ";
789 val () = Env
.action_none
"forceTypeOff"
790 (fn () => write
"\tForceType None\n")
792 val () = Env
.action_two
"action"
793 ("what", Env
.string, "how", Env
.string)
794 (fn (what
, how
) => (write
"\tAction ";
800 val () = Env
.action_one
"addDefaultCharset"
801 ("charset", Env
.string)
802 (fn ty
=> (write
"\tAddDefaultCharset ";
806 (*val () = Env
.action_one
"davSvn"
808 (fn path
=> (write
"\tDAV svn\n\tSVNPath ";
812 val () = Env
.action_one
"authzSvnAccessFile"
814 (fn path
=> (write
"\tAuthzSVNAccessFile ";
818 val () = Env
.action_none
"davFilesystem"
819 (fn path
=> write
"\tDAV filesystem\n")
821 val () = Env
.action_two
"addDescription"
822 ("description", Env
.string, "patterns", Env
.list Env
.string)
826 | _
=> (write
"\tAddDescription \"";
827 write (String.toString desc
);
829 app (fn pat
=> (write
" "; write pat
)) pats
;
832 val () = Env
.action_one
"indexOptions"
833 ("options", Env
.list autoindex_option
)
837 | _
=> (write
"\tIndexOptions";
838 app (fn (opt
, arg
) =>
841 Option
.app (fn arg
=>
842 (write
"="; write arg
)) arg
)) opts
;
845 val () = Env
.action_one
"set_indexOptions"
846 ("options", Env
.list autoindex_option
)
850 | _
=> (write
"\tIndexOptions";
851 app (fn (opt
, arg
) =>
854 Option
.app (fn arg
=>
855 (write
"="; write arg
)) arg
)) opts
;
858 val () = Env
.action_one
"unset_indexOptions"
859 ("options", Env
.list autoindex_option
)
863 | _
=> (write
"\tIndexOptions";
869 val () = Env
.action_one
"headerName"
871 (fn name
=> (write
"\tHeaderName ";
875 val () = Env
.action_one
"readmeName"
877 (fn name
=> (write
"\tReadmeName ";
881 val () = Env
.action_two
"setEnv"
882 ("key", Env
.string, "value", Env
.string)
883 (fn (key
, value
) => (write
"\tSetEnv \"";
886 write (String.translate (fn #
"\"" => "\\\""
887 | ch
=> str ch
) value
);
890 val () = Domain
.registerResetLocal (fn () =>
891 ignore (OS
.Process
.system (Config
.rm ^
" -rf /var/domtool/vhosts/*")))
893 val () = Domain
.registerDescriber (Domain
.considerAll
894 [Domain
.Extension
{extension
= "vhost",
895 heading
= fn host
=> "Web vhost: " ^ host
},
896 Domain
.Extension
{extension
= "vhost_ssl",
897 heading
= fn host
=> "SSL web vhost: " ^ host
}])