diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2020-08-24 13:42:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-24 13:42:11 +0100 |
commit | 4c9ad3ca793e2418a725f2c227108b71db109913 (patch) | |
tree | 3dfb818a33da2cf65515970586a1723cb8792cb3 /nixos/modules/services/web-servers/apache-httpd/default.nix | |
parent | 5c70c5eeaa275aae90e1d3e5b63a6fdcf29bc850 (diff) | |
parent | e207de63f4f4a8f377eed1f522dc872f338eb26c (diff) | |
download | nixpkgs-4c9ad3ca793e2418a725f2c227108b71db109913.tar nixpkgs-4c9ad3ca793e2418a725f2c227108b71db109913.tar.gz nixpkgs-4c9ad3ca793e2418a725f2c227108b71db109913.tar.bz2 nixpkgs-4c9ad3ca793e2418a725f2c227108b71db109913.tar.lz nixpkgs-4c9ad3ca793e2418a725f2c227108b71db109913.tar.xz nixpkgs-4c9ad3ca793e2418a725f2c227108b71db109913.tar.zst nixpkgs-4c9ad3ca793e2418a725f2c227108b71db109913.zip |
Merge branch 'master' into nginx-update
Diffstat (limited to 'nixos/modules/services/web-servers/apache-httpd/default.nix')
-rw-r--r-- | nixos/modules/services/web-servers/apache-httpd/default.nix | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix index e1d1217943b..fc4c2945394 100644 --- a/nixos/modules/services/web-servers/apache-httpd/default.nix +++ b/nixos/modules/services/web-servers/apache-httpd/default.nix @@ -10,6 +10,12 @@ let pkg = cfg.package.out; + apachectl = pkgs.runCommand "apachectl" { meta.priority = -1; } '' + mkdir -p $out/bin + cp ${pkg}/bin/apachectl $out/bin/apachectl + sed -i $out/bin/apachectl -e 's|$HTTPD -t|$HTTPD -t -f ${httpdConf}|' + ''; + httpdConf = cfg.configFile; php = cfg.phpPackage.override { apacheHttpd = pkg; }; @@ -650,10 +656,29 @@ in postRun = "systemctl reload httpd.service"; }) (filterAttrs (name: hostOpts: hostOpts.enableACME) cfg.virtualHosts); - environment.systemPackages = [ pkg ]; + environment.systemPackages = [ + apachectl + pkg + ]; - # 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 = '' |