瀏覽代碼

Added ability to replace default vhost with own version

Added example shows 503 code instead of "It works!" page.
master
Alexander Kozlov 9 年之前
父節點
當前提交
f7940ecdc1
共有 3 個文件被更改,包括 26 次插入0 次删除
  1. +5
    -0
      README.rst
  2. +4
    -0
      apache/files/Debian/sites-available/000-default.conf
  3. +17
    -0
      apache/own_default_vhost.sls

+ 5
- 0
README.rst 查看文件

@@ -90,6 +90,11 @@ Enables the Apache module vhost_alias (Debian Only)

Configures Apache name-based virtual hosts and creates virtual host directories using data from Pillar.

``apache.own_default_vhost``
--------------------------

Replace default vhost with own version. By default, it's 503 code. (Debian Only)

Example Pillar:

.. code:: yaml

+ 4
- 0
apache/files/Debian/sites-available/000-default.conf 查看文件

@@ -0,0 +1,4 @@
<VirtualHost *:80>
RewriteEngine on
RewriteRule ^/(.*) blah [R=503]
</VirtualHost>

+ 17
- 0
apache/own_default_vhost.sls 查看文件

@@ -0,0 +1,17 @@
{% if grains['os_family']=="Debian" %}

{% from "apache/map.jinja" import apache with context %}

include:
- apache

apache_own-default-vhost:
file.managed:
- name: {{ apache.vhostdir }}/000-default.conf
- source: salt://apache/files/{{ salt['grains.get']('os_family') }}/sites-available/000-default.conf
- require:
- pkg: apache
- watch_in:
- module: apache-reload

{% endif %}

Loading…
取消
儲存