2015-12-10 22:40:51 +01:00
|
|
|
{{ apache_global_vhost_settings }}
|
2014-02-28 23:23:24 +01:00
|
|
|
|
2014-11-05 17:07:20 +01:00
|
|
|
{# Set up VirtualHosts #}
|
2014-02-28 23:23:24 +01:00
|
|
|
{% for vhost in apache_vhosts %}
|
2016-04-20 11:46:12 +02:00
|
|
|
<VirtualHost {{ apache_listen_ip }}:{{ apache_listen_port }}>
|
2014-02-28 23:23:24 +01:00
|
|
|
ServerName {{ vhost.servername }}
|
2014-12-29 21:56:03 +01:00
|
|
|
{% if vhost.serveralias is defined %}
|
|
|
|
ServerAlias {{ vhost.serveralias }}
|
|
|
|
{% endif %}
|
2016-01-03 05:25:49 +01:00
|
|
|
{% if vhost.documentroot is defined %}
|
2014-02-28 23:23:24 +01:00
|
|
|
DocumentRoot {{ vhost.documentroot }}
|
2016-01-03 05:25:49 +01:00
|
|
|
{% endif %}
|
2014-11-05 17:07:20 +01:00
|
|
|
|
|
|
|
{% if vhost.serveradmin is defined %}
|
|
|
|
ServerAdmin {{ vhost.serveradmin }}
|
|
|
|
{% endif %}
|
2016-01-03 05:46:25 +01:00
|
|
|
{% if vhost.documentroot is defined %}
|
2014-11-05 17:07:20 +01:00
|
|
|
<Directory "{{ vhost.documentroot }}">
|
2016-04-25 16:00:03 +02:00
|
|
|
AllowOverride {{ vhost.allow_override | default(apache_allow_override) }}
|
|
|
|
Options {{ vhost.options | default(apache_options) }}
|
2016-04-25 15:56:30 +02:00
|
|
|
{% if apache_vhosts_version == "2.2" %}
|
|
|
|
Order allow,deny
|
|
|
|
Allow from all
|
|
|
|
{% else %}
|
2014-11-05 17:07:20 +01:00
|
|
|
Require all granted
|
2016-04-25 15:56:30 +02:00
|
|
|
{% endif %}
|
2014-11-05 17:07:20 +01:00
|
|
|
</Directory>
|
2016-01-03 05:46:25 +01:00
|
|
|
{% endif %}
|
2014-11-05 17:07:20 +01:00
|
|
|
{% if vhost.extra_parameters is defined %}
|
|
|
|
{{ vhost.extra_parameters }}
|
|
|
|
{% endif %}
|
|
|
|
</VirtualHost>
|
|
|
|
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
{# Set up SSL VirtualHosts #}
|
|
|
|
{% for vhost in apache_vhosts_ssl %}
|
2016-01-16 16:55:07 +01:00
|
|
|
{% if apache_ignore_missing_ssl_certificate or apache_ssl_certificates.results[loop.index0].stat.exists %}
|
2016-04-20 11:46:12 +02:00
|
|
|
<VirtualHost {{ apache_listen_ip }}:{{ apache_listen_port_ssl }}>
|
2014-11-05 17:07:20 +01:00
|
|
|
ServerName {{ vhost.servername }}
|
2014-12-29 21:56:03 +01:00
|
|
|
{% if vhost.serveralias is defined %}
|
|
|
|
ServerAlias {{ vhost.serveralias }}
|
|
|
|
{% endif %}
|
2016-01-03 05:46:25 +01:00
|
|
|
{% if vhost.documentroot is defined %}
|
2014-11-05 17:07:20 +01:00
|
|
|
DocumentRoot {{ vhost.documentroot }}
|
2016-01-03 05:46:25 +01:00
|
|
|
{% endif %}
|
2014-11-05 17:07:20 +01:00
|
|
|
|
|
|
|
SSLEngine on
|
|
|
|
SSLCipherSuite {{ apache_ssl_cipher_suite }}
|
|
|
|
SSLProtocol {{ apache_ssl_protocol }}
|
|
|
|
SSLHonorCipherOrder On
|
2016-04-25 15:56:30 +02:00
|
|
|
{% if apache_vhosts_version == "2.4" %}
|
2014-11-05 17:07:20 +01:00
|
|
|
SSLCompression off
|
2016-04-25 15:56:30 +02:00
|
|
|
{% endif %}
|
2014-11-05 17:07:20 +01:00
|
|
|
SSLCertificateFile {{ vhost.certificate_file }}
|
|
|
|
SSLCertificateKeyFile {{ vhost.certificate_key_file }}
|
|
|
|
{% if vhost.certificate_chain_file is defined %}
|
|
|
|
SSLCertificateChainFile {{ vhost.certificate_chain_file }}
|
|
|
|
{% endif %}
|
|
|
|
|
2014-02-28 23:23:24 +01:00
|
|
|
{% if vhost.serveradmin is defined %}
|
|
|
|
ServerAdmin {{ vhost.serveradmin }}
|
|
|
|
{% endif %}
|
2016-01-03 05:46:25 +01:00
|
|
|
{% if vhost.documentroot is defined %}
|
2014-02-28 23:23:24 +01:00
|
|
|
<Directory "{{ vhost.documentroot }}">
|
2016-04-25 16:00:03 +02:00
|
|
|
AllowOverride {{ vhost.allow_override | default(apache_allow_override) }}
|
|
|
|
Options {{ vhost.options | default(apache_options) }}
|
2016-04-25 15:56:30 +02:00
|
|
|
{% if apache_vhosts_version == "2.2" %}
|
|
|
|
Order allow,deny
|
|
|
|
Allow from all
|
|
|
|
{% else %}
|
2014-10-06 01:15:56 +02:00
|
|
|
Require all granted
|
2016-04-25 15:56:30 +02:00
|
|
|
{% endif %}
|
2014-02-28 23:23:24 +01:00
|
|
|
</Directory>
|
2016-01-03 05:46:25 +01:00
|
|
|
{% endif %}
|
2014-02-28 23:23:24 +01:00
|
|
|
{% if vhost.extra_parameters is defined %}
|
|
|
|
{{ vhost.extra_parameters }}
|
|
|
|
{% endif %}
|
|
|
|
</VirtualHost>
|
|
|
|
|
2016-01-16 16:55:07 +01:00
|
|
|
{% endif %}
|
2014-02-28 23:23:24 +01:00
|
|
|
{% endfor %}
|