Browse Source

FreeBSD: mod_rewrite

master
Alexander Weidinger 8 years ago
parent
commit
f03df6e2fb
3 changed files with 18 additions and 2 deletions
  1. +1
    -1
      README.rst
  2. +3
    -0
      apache/files/FreeBSD/mod_rewrite.conf.jinja
  3. +14
    -1
      apache/mod_rewrite.sls

+ 1
- 1
README.rst View File

@@ -38,7 +38,7 @@ Enables and disables Apache modules.
``apache.mod_rewrite``
----------------------

Enabled the Apache module mod_rewrite (Debian only)
Enabled the Apache module mod_rewrite (Debian and FreeBSD only)

``apache.mod_proxy``
-------------------

+ 3
- 0
apache/files/FreeBSD/mod_rewrite.conf.jinja View File

@@ -0,0 +1,3 @@
{% from "apache/map.jinja" import apache with context %}

LoadModule rewrite_module libexec/{{ apache.service }}/mod_rewrite.so

+ 14
- 1
apache/mod_rewrite.sls View File

@@ -1,8 +1,9 @@
{% if grains['os_family']=="Debian" %}
{% from "apache/map.jinja" import apache with context %}

include:
- apache

{% if grains['os_family']=="Debian" %}
a2enmod rewrite:
cmd.run:
- unless: ls /etc/apache2/mods-enabled/rewrite.load
@@ -12,4 +13,16 @@ a2enmod rewrite:
- watch_in:
- module: apache-restart

{% elif grains['os_family']=="FreeBSD" %}

{{ apache.modulesdir }}/040_mod_rewrite.conf:
file.managed:
- source: salt://apache/files/{{ salt['grains.get']('os_family') }}/mod_rewrite.conf.jinja
- mode: 644
- template: jinja
- require:
- pkg: apache
- watch_in:
- module: apache-restart

{% endif %}

Loading…
Cancel
Save