Quellcode durchsuchen

Add support for NameVirtualHost on Debian

tags/v0.37.4
Dominik Menzi vor 8 Jahren
Ursprung
Commit
d1c3463154
3 geänderte Dateien mit 36 neuen und 0 gelöschten Zeilen
  1. +15
    -0
      apache/files/Debian/ports-2.2.conf.jinja
  2. +15
    -0
      apache/files/Debian/ports-2.4.conf.jinja
  3. +6
    -0
      pillar.example

+ 15
- 0
apache/files/Debian/ports-2.2.conf.jinja Datei anzeigen

@@ -28,3 +28,18 @@ Listen 80
Listen 443
</IfModule>
{%- endif %}

{%- if salt['pillar.get']('apache:name_virtual_hosts') is iterable %}
{%- set name_virtual_host_directives = [] %}

{%- for name_virtual_host in salt['pillar.get']('apache:name_virtual_hosts') %}
{%- set interface = name_virtual_host.get('interface', '*') %}
{%- set port = name_virtual_host.get('port', 80) %}
{%- set name_virtual_host_directive = interface ~ ':' ~ port %}
{%- do name_virtual_host_directives.append(name_virtual_host_directive) %}
{%- endfor %}

{%- for name_virtual_host in name_virtual_host_directives %}
NameVirtualHost {{ name_virtual_host }}
{%- endfor %}
{%- endif -%}

+ 15
- 0
apache/files/Debian/ports-2.4.conf.jinja Datei anzeigen

@@ -28,3 +28,18 @@ Listen 80
Listen 443
</IfModule>
{%- endif %}

{%- if salt['pillar.get']('apache:name_virtual_hosts') is iterable %}
{%- set name_virtual_host_directives = [] %}

{%- for name_virtual_host in salt['pillar.get']('apache:name_virtual_hosts') %}
{%- set interface = name_virtual_host.get('interface', '*') %}
{%- set port = name_virtual_host.get('port', 80) %}
{%- set name_virtual_host_directive = interface ~ ':' ~ port %}
{%- do name_virtual_host_directives.append(name_virtual_host_directive) %}
{%- endfor %}

{%- for name_virtual_host in name_virtual_host_directives %}
NameVirtualHost {{ name_virtual_host }}
{%- endfor %}
{%- endif -%}

+ 6
- 0
pillar.example Datei anzeigen

@@ -23,6 +23,12 @@ apache:
AllowEncodedSlashes: "On"


name_virtual_hosts:
- interface: *
port: 80
- interface: *
port: 443

# ``apache.vhosts`` formula additional configuration:
sites:
example.net:

Laden…
Abbrechen
Speichern