2018-02-04 14:13:18 +01:00
|
|
|
#
|
|
|
|
# This file is managed by Salt! Do not edit by hand!
|
|
|
|
#
|
2017-04-23 19:38:17 +02:00
|
|
|
{# Define default values here so the template below can just focus on layout #}
|
|
|
|
{%- set sitename = site.get('ServerName', id) -%}
|
|
|
|
|
|
|
|
{%- set vals = {
|
|
|
|
'interfaces': site.get('interface', '*').split(),
|
|
|
|
'port': site.get('port', '80'),
|
|
|
|
|
|
|
|
'ServerName': sitename,
|
2018-01-31 00:20:25 +01:00
|
|
|
'ServerAlias': site.get('ServerAlias', ''),
|
2017-04-23 19:38:17 +02:00
|
|
|
|
|
|
|
'ServerAdmin': site.get('ServerAdmin', 'webmaster@{0}'.format(sitename)),
|
|
|
|
|
|
|
|
'LogLevel': site.get('LogLevel', 'warn'),
|
|
|
|
'ErrorLog': site.get('ErrorLog', '{0}/{1}-error.log'.format(map.logdir, sitename)),
|
2018-01-05 00:59:57 +01:00
|
|
|
'CustomLog': site.get('CustomLog', '{0}/{1}-access.log'.format(map.logdir, sitename)),
|
2017-11-05 13:44:24 +01:00
|
|
|
'LogFormat': site.get('LogFormat', '"%h %l %u %t \\\"%r\\\" %>s %b"'),
|
2017-11-04 19:38:31 +01:00
|
|
|
|
2017-04-23 19:38:17 +02:00
|
|
|
|
|
|
|
'DocumentRoot': site.get('DocumentRoot', '{0}/{1}'.format(map.wwwdir, sitename))
|
|
|
|
} -%}
|
|
|
|
|
2019-10-17 08:55:56 +02:00
|
|
|
<VirtualHost {% for intf in vals.interfaces %} {{ intf }}:{{ vals.port }}{% endfor -%}>
|
2017-04-23 19:38:17 +02:00
|
|
|
ServerName {{ vals.ServerName }}
|
|
|
|
{% if site.get('ServerAlias') != False %}ServerAlias {{ vals.ServerAlias }}{% endif %}
|
|
|
|
{% if site.get('ServerAdmin') != False %}ServerAdmin {{ vals.ServerAdmin }}{% endif %}
|
|
|
|
|
|
|
|
{% if site.get('DocumentRoot') != False -%}DocumentRoot {{ vals.DocumentRoot }}{% endif %}
|
|
|
|
|
|
|
|
{% if site.get('LogLevel') != False -%}LogLevel {{ vals.LogLevel }}{% endif %}
|
|
|
|
{% if site.get('ErrorLog') != False -%}ErrorLog {{ vals.ErrorLog }}{% endif %}
|
2018-01-05 01:30:42 +01:00
|
|
|
{% if site.get('LogFormat') != False -%}LogFormat {{ vals.LogFormat }}{% endif %}
|
|
|
|
{% if site.get('CustomLog') != False -%}LogFormat {{ vals.LogFormat }} {{ sitename }}
|
|
|
|
CustomLog {{ vals.CustomLog }} {{ sitename }}{% endif %}
|
2017-04-23 19:38:17 +02:00
|
|
|
</VirtualHost>
|