3
0
Fork 0
forked from mirrors/nixpkgs

nixos/httpd: configure log rotation

This commit is contained in:
Aaron Andersen 2020-08-19 12:38:20 -04:00
parent 00f08005af
commit 06d17caf92

View file

@ -655,6 +655,25 @@ in
# required for "apachectl configtest"
environment.etc."httpd/httpd.conf".source = httpdConf;
services.logrotate = optionalAttrs (cfg.logFormat != "none") {
enable = mkDefault true;
paths.httpd = {
path = "${cfg.logDir}/*.log";
user = cfg.user;
group = cfg.group;
frequency = "daily";
keep = 28;
extraConfig = ''
sharedscripts
compress
delaycompress
postrotate
systemctl reload httpd.service > /dev/null 2>/dev/null || true
endscript
'';
};
};
services.httpd.phpOptions =
''
; Needed for PHP's mail() function.