Add end_in_slash and use it to fix moinMoin; do extra reduction during evaluation
[hcoop/domtool2.git] / lib / web_apps.dtl
1 {{Configuring common web applications}}
2
3 val addWordPress = \ loc : (location) ->
4 location loc with
5 rewriteCond "%{REQUEST_FILENAME}" "!-f" [];
6 rewriteCond "%{REQUEST_FILENAME}" "!-d" [];
7 rewriteRule "." "/index.php" [last]
8 end;
9 {{Add a standard WordPress blog set-up code to a virtual host. The WordPress
10 files should be rooted at the location you specify.}}
11
12 val wordPress = \ host : (host) ->
13 web host with
14 addWordPress "/"
15 end;
16 {{Create a WordPress blog with just the standard set-up code. The WordPress blog should
17 be rooted at the vhost's <tt>DocumentRoot</tt>.}}
18
19 val addMoinMoin = begin
20 htdocs <- Htdocs;
21 prefix <- Prefix;
22 script <- Script;
23
24 alias htdocs "/usr/share/moin/htdocs";
25 scriptAlias prefix (end_in_slash script)
26 end;
27 {{Add a MoinMoin wiki to a vhost.}}
28
29 val moinMoin = \ host : (host) ->
30 web host with
31 addMoinMoin where
32 Htdocs = "/moin";
33 Prefix = "/"
34 end
35 end;
36 {{Create a new vhost with just a MoinMoin wiki.}}