Templates

directory-block.j2

Synopsis: Template directory-block.

Description of the template.

[templates/directory-block.j2]

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

section2.j2

Synopsis: Template section2.

Description of the template.

[templates/section2.j2]

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

vhost2.j2

Synopsis: Template vhost2.

Description of the template.

[templates/vhost2.j2]

1{% for vhost in item.vars %}
2{{ vhost | encode_apache }}
3{% 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     <VirtualHost *:80>
 2     ServerName {{ item.ServerName }}
 3     DocumentRoot {{ item.DocumentRoot }}
 4{% if item.redirect|default(True) %}     Redirect permanent / https://{{ item.ServerName }}/
 5{% endif %}
 6     </VirtualHost>
 7
 8     <VirtualHost *:443>
 9     ServerName {{ item.ServerName }}
10     DocumentRoot {{ item.DocumentRoot }}
11     SSLCertificateFile {{ item.SSLCertificateFile }}
12     SSLCertificateKeyFile {{ item.SSLCertificateKeyFile }}
13     </VirtualHost>

See also