Templates

directory-block.j2

Synopsis: Template directory-block.

Description of the template.

[templates/directory-block.j2]

1
2
3
4
5
<Directory {{ item.Directory }}>
{% for confitem in item.Conf %}
  {{ confitem }}
{% endfor %}
</Directory>

section2.j2

Synopsis: Template section2.

Description of the template.

[templates/section2.j2]

1
2
3
{% for section in item.vars %}
{{ section | encode_apache }}
{% endfor %}

vhost2.j2

Synopsis: Template vhost2.

Description of the template.

[templates/vhost2.j2]

1
2
3
{% for vhost in item.vars %}
{{ vhost | encode_apache }}
{% endfor %}

vhost.j2

Synopsis: Create virtual servers.

Create both http and https servers (1,8). Optionally default(True) redirect permanent http to https (4).

[templates/vhost.j2]

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
     <VirtualHost *:80>
     ServerName {{ item.ServerName }}
     DocumentRoot {{ item.DocumentRoot }}
{% if item.redirect|default(True) %}     Redirect permanent / https://{{ item.ServerName }}/
{% endif %}
     </VirtualHost>

     <VirtualHost *:443>
     ServerName {{ item.ServerName }}
     DocumentRoot {{ item.DocumentRoot }}
     SSLCertificateFile {{ item.SSLCertificateFile }}
     SSLCertificateKeyFile {{ item.SSLCertificateKeyFile }}
     </VirtualHost>

See also