Browse Source

vhosts/standard: allow user/group option

Support for DocumentRootUser and DocumentRootGroup
master
Adrien "ze" Urban 6 years ago
parent
commit
5211bdd72b
2 changed files with 8 additions and 0 deletions
  1. +6
    -0
      apache/vhosts/standard.sls
  2. +2
    -0
      pillar.example

+ 6
- 0
apache/vhosts/standard.sls View File

@@ -27,6 +27,12 @@ include:
- unless: test -d {{ documentroot }}
- name: {{ documentroot }}
- makedirs: True
{% if site.get('DocumentRootUser') %}
- user: {{ site.DocumentRootUser }}
{% endif %}
{% if site.get('DocumentRootGroup') %}
- group: {{ site.DocumentRootGroup }}
{% endif %}
- allow_symlink: True
{% endif %}


+ 2
- 0
pillar.example View File

@@ -71,6 +71,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: www-data # Force user if specified, leave it default if not
DocumentRootGroup: www-data # Force group if specified, leave it default if not

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

Loading…
Cancel
Save