apache-config-file-directory-logdir: | apache-config-file-directory-logdir: | ||||
file.directory: | file.directory: | ||||
- name: {{ apache.logdir }} | - name: {{ apache.logdir }} | ||||
- user: {{ apache.user }} | |||||
- group: {{ apache.group }} | |||||
- user: {{ apache.get('logdir_user', apache.user) }} | |||||
- group: {{ apache.get('logdir_group', apache.group) }} | |||||
- makedirs: True | - makedirs: True | ||||
- require: | - require: | ||||
- sls: {{ sls_package_install }} | - sls: {{ sls_package_install }} | ||||
apache-config-file-managed-{{ grains.os }}-env: | apache-config-file-managed-{{ grains.os }}-env: | ||||
file.managed: | file.managed: | ||||
- name: /etc/apache2/envvars | |||||
- name: {{ apache.envvarsfile }} | |||||
- source: 'salt://apache/files/{{ grains.os_family }}/envvars-{{ apache.version }}.jinja' | - source: 'salt://apache/files/{{ grains.os_family }}/envvars-{{ apache.version }}.jinja' | ||||
- mode: 644 | - mode: 644 | ||||
- user: {{ apache.rootuser }} | - user: {{ apache.rootuser }} |
/bin/systemctl reload {{ apache.service.name }}.service > /dev/null 2>/dev/null || true | /bin/systemctl reload {{ apache.service.name }}.service > /dev/null 2>/dev/null || true | ||||
endscript | endscript | ||||
} | } | ||||
{% elif grains.os_family == "FreeBSD" %} | |||||
- contents: | | |||||
{{ apache.logdir }}/httpd-*.log { | |||||
daily | |||||
missingok | |||||
rotate 14 | |||||
compress | |||||
delaycompress | |||||
notifempty | |||||
create 640 root wheel | |||||
sharedscripts | |||||
postrotate | |||||
if service {{ apache.service.name }} status >/dev/null; then \ | |||||
service {{ apache.service.name }} reload >/dev/null; \ | |||||
fi; | |||||
endscript | |||||
prerotate | |||||
if [ -d /usr/local/etc/logrotate.d/httpd-prerotate ]; then \ | |||||
run-parts /usr/local/etc/logrotate.d/httpd-prerotate; \ | |||||
fi; \ | |||||
endscript | |||||
{% else %} | {% else %} | ||||
- contents: | | - contents: | | ||||
{{ apache.logdir }}/*.log { | {{ apache.logdir }}/*.log { |
name: apache | name: apache | ||||
user: www-data | user: www-data | ||||
group: www-data | group: www-data | ||||
envvarsfile: /etc/apache2/envvars | |||||
vhostdir: /etc/apache2/sites-available | vhostdir: /etc/apache2/sites-available | ||||
confdir: /etc/apache2/conf.d | confdir: /etc/apache2/conf.d | ||||
davlockdbdir: null | davlockdbdir: null |
group: www | group: www | ||||
config: /usr/local/etc/apache24/httpd.conf | config: /usr/local/etc/apache24/httpd.conf | ||||
portsfile: /usr/local/etc/apache24/ports.conf | portsfile: /usr/local/etc/apache24/ports.conf | ||||
envvarsfile: /usr/local/etc/apache24/envvars.d/by_salt.env | |||||
mod_php5: mod_php56 | mod_php5: mod_php56 | ||||
mod_perl2: ap24-mod_perl2 | mod_perl2: ap24-mod_perl2 | ||||
default_site: default | default_site: default | ||||
default_site_ssl: default-ssl | default_site_ssl: default-ssl | ||||
moddir: /usr/local/etc/apache24/modules.d | moddir: /usr/local/etc/apache24/modules.d | ||||
logdir: /var/log/ | |||||
logdir: /var/log | |||||
logdir_user: root | |||||
logdir_group: wheel | |||||
logrotatedir: /usr/local/etc/logrotate.d/apache2 | logrotatedir: /usr/local/etc/logrotate.d/apache2 | ||||
wwwdir: /usr/local/www/apache24/ | wwwdir: /usr/local/www/apache24/ | ||||