diff --git a/apache/vhosts/standard.sls b/apache/vhosts/standard.sls index 5ccd137..9b0f49c 100644 --- a/apache/vhosts/standard.sls +++ b/apache/vhosts/standard.sls @@ -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 %} diff --git a/pillar.example b/pillar.example index d14304f..9d8330b 100644 --- a/pillar.example +++ b/pillar.example @@ -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