1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-02 18:42:15 +00:00

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.