1 |
<%- if use_ssl then |
2 |
port = 443 |
3 |
else |
4 |
port = 80 |
5 |
end |
6 |
-%> |
7 |
|
8 |
<VirtualHost *:<%= port %>> |
9 |
<%- if use_ssl then -%> |
10 |
<%= scope.function_template(["apache/vhost_ssl.conf"]) %> |
11 |
<%- end -%> |
12 |
ServerName <%= real_vhost %> |
13 |
<%- server_aliases.each do |key| -%> |
14 |
ServerAlias <%= key %> |
15 |
<%- end -%> |
16 |
DocumentRoot <%= location %> |
17 |
|
18 |
CustomLog <%= real_access_logfile %> combined |
19 |
ErrorLog <%= real_error_logfile %> |
20 |
|
21 |
<%- if enable_public_html -%> |
22 |
#TODO add the rest |
23 |
UserDir public_html |
24 |
<%- else -%> |
25 |
<IfModule mod_userdir.c> |
26 |
UserDir disabled |
27 |
</IfModule> |
28 |
<%- end -%> |
29 |
|
30 |
<%- aliases.keys.sort {|a,b| a.size <=> b.size }.reverse.each do |key| -%> |
31 |
Alias <%= key %> <%= aliases[key] %> |
32 |
<%- end -%> |
33 |
|
34 |
<%= content %> |
35 |
|
36 |
<%- if options.length > 0 -%> |
37 |
<Directory <%= location %>> |
38 |
Options <%= options.join(" ") %> |
39 |
</Directory> |
40 |
<%- end -%> |
41 |
|
42 |
<Location /> |
43 |
Allow from all |
44 |
</Location> |
45 |
</VirtualHost> |
46 |
|