Quellcode durchsuchen

Merge pull request #230 from ze42/docroot_owner

vhosts/standard: allow to set docroot ownership
tags/v0.37.4
Niels Abspoel vor 6 Jahren
Ursprung
Commit
03de980860
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden
2 geänderte Dateien mit 9 neuen und 1 gelöschten Zeilen
  1. +2
    -1
      apache/vhosts/standard.sls
  2. +7
    -0
      pillar.example

+ 2
- 1
apache/vhosts/standard.sls Datei anzeigen

@@ -24,9 +24,10 @@ include:
{% if site.get('DocumentRoot') != False %}
{{ id }}-documentroot:
file.directory:
- unless: test -d {{ documentroot }}
- name: {{ documentroot }}
- makedirs: True
- user: {{ site.get('DocumentRootUser', apache.get('document_root_user'))|json }}
- group: {{ site.get('DocumentRootGroup', apache.get('document_root_group'))|json }}
- allow_symlink: True
{% endif %}


+ 7
- 0
pillar.example Datei anzeigen

@@ -26,6 +26,11 @@ apache:
# Default value for AddDefaultCharset in RedHat configuration
default_charset: 'UTF-8'

# Should we enforce DocumentRoot user/group?
# Default: do not enforce
document_root_user: www-data # Force user if specified, leave it default if not
document_root_group: null # Do not enforce group

global:
# global apache directives
AllowEncodedSlashes: 'On'
@@ -71,6 +76,8 @@ apache:
CustomLog: /path/to/logs/example.com-access.log # E.g.: /var/log/apache2/example.com-access.log

DocumentRoot: /path/to/www/dir/example.com # E.g., /var/www/example.com
DocumentRootUser: null # do not enforce user, defaults to lookup:document_root_user
DocumentRootGroup: www-data # Force group, defaults to lookup:document_root_group

SSLCertificateFile: /etc/ssl/mycert.pem # if ssl is desired
SSLCertificateKeyFile: /etc/ssl/mycert.pem.key # if key for cert is needed or in an extra file

Laden…
Abbrechen
Speichern