ansible-role-apache/templates/vhosts-2.2.conf.j2
fabiank88 24d7e84f61 Update vhosts-2.2.conf.j2
I wanted to be able to add some .htaccess authentication and other stuff
2015-11-17 23:25:51 +01:00

70 lines
1.9 KiB
Django/Jinja

DirectoryIndex index.php index.html
{# Set up VirtualHosts #}
{% for vhost in apache_vhosts %}
<VirtualHost *:{{ apache_listen_port }}>
ServerName {{ vhost.servername }}
{% if vhost.serveralias is defined %}
ServerAlias {{ vhost.serveralias }}
{% endif %}
DocumentRoot {{ vhost.documentroot }}
{% if vhost.serveradmin is defined %}
ServerAdmin {{ vhost.serveradmin }}
{% endif %}
<Directory "{{ vhost.documentroot }}">
{% if vhost.directory_parameters is defined %}
{{ vhost.directory_parameters }}
{% else %}
AllowOverride All
Options -Indexes FollowSymLinks
Order allow,deny
Allow from all
{% endif %}
</Directory>
{% if vhost.extra_parameters is defined %}
{{ vhost.extra_parameters }}
{% endif %}
</VirtualHost>
{% endfor %}
{# Set up SSL VirtualHosts. #}
{% for vhost in apache_vhosts_ssl %}
<VirtualHost *:{{ apache_listen_port_ssl }}>
ServerName {{ vhost.servername }}
{% if vhost.serveralias is defined %}
ServerAlias {{ vhost.serveralias }}
{% endif %}
DocumentRoot {{ vhost.documentroot }}
SSLEngine on
SSLCipherSuite {{ apache_ssl_cipher_suite }}
SSLProtocol {{ apache_ssl_protocol }}
SSLHonorCipherOrder On
SSLCertificateFile {{ vhost.certificate_file }}
SSLCertificateKeyFile {{ vhost.certificate_key_file }}
{% if vhost.certificate_chain_file is defined %}
SSLCertificateChainFile {{ vhost.certificate_chain_file }}
{% endif %}
{% if vhost.serveradmin is defined %}
ServerAdmin {{ vhost.serveradmin }}
{% endif %}
<Directory "{{ vhost.documentroot }}">
{% if vhost.directory_parameters is defined %}
{{ vhost.directory_parameters }}
{% else %}
AllowOverride All
Options -Indexes FollowSymLinks
Order allow,deny
Allow from all
{% endif %}
</Directory>
{% if vhost.extra_parameters is defined %}
{{ vhost.extra_parameters }}
{% endif %}
</VirtualHost>
{% endfor %}