aboutsummaryrefslogtreecommitdiffstats
path: root/modules/apache/templates/vhost_base.conf
blob: 84c8f9184461704c6df090aa5f4bc12f62cc9c2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<%- if use_ssl then
    port = 443
else
    port = 80
end
-%>

<VirtualHost *:<%= port %>>
<%- if use_ssl then -%>
<%= scope.function_template(["apache/vhost_ssl.conf"]) %>
<%- end -%>
        ServerName <%= real_vhost %>
<%- server_aliases.each do |key| -%>
        ServerAlias <%= key %>
<%- end -%>
        DocumentRoot <%= location %>

	CustomLog <%= real_access_logfile %> combined
	ErrorLog <%= real_error_logfile %>

<%- if enable_public_html -%>
        #TODO add the rest
        UserDir public_html
<%- else -%>
<IfModule mod_userdir.c>
        UserDir disabled
</IfModule>
<%- end -%>

<%- aliases.keys.sort {|a,b| a.size <=> b.size }.reverse.each do |key| -%>
        Alias <%= key %> <%= aliases[key] %>
<%- end -%>

        <%= content %>

<%- if options.length > 0 -%>
        <Directory <%= location %>>
            Options <%= options.join(" ") %>
        </Directory>
<%- end -%>

<%- if enable_location -%>
        <Location />
            <IfModule mod_authz_core.c>
                Require all granted
            </IfModule>
            <IfModule !mod_authz_core.c>
                Allow from all
            </IfModule>
        </Location>
<%- end -%>
</VirtualHost>