···
apachectl = pkgs.runCommand "apachectl" { meta.priority = -1; } ''
cp ${pkg}/bin/apachectl $out/bin/apachectl
18
-
sed -i $out/bin/apachectl -e 's|$HTTPD -t|$HTTPD -t -f ${httpdConf}|'
18
+
sed -i $out/bin/apachectl -e 's|$HTTPD -t|$HTTPD -t -f /etc/httpd/httpd.conf|'
21
-
httpdConf = cfg.configFile;
php = cfg.phpPackage.override { apacheHttpd = pkg; };
···
}) (filter (hostOpts: hostOpts.useACMEHost == null) acmeEnabledVhosts);
in listToAttrs acmePairs;
683
+
# httpd requires a stable path to the configuration file for reloads
684
+
environment.etc."httpd/httpd.conf".source = cfg.configFile;
environment.systemPackages = [
···
wants = concatLists (map (certName: [ "acme-finished-${certName}.target" ]) dependentCertNames);
after = [ "network.target" ] ++ map (certName: "acme-selfsigned-${certName}.service") dependentCertNames;
before = map (certName: "acme-${certName}.service") dependentCertNames;
756
+
restartTriggers = [ cfg.configFile ];
path = [ pkg pkgs.coreutils pkgs.gnugrep ];
···
774
-
ExecStart = "@${pkg}/bin/httpd httpd -f ${httpdConf}";
775
-
ExecStop = "${pkg}/bin/httpd -f ${httpdConf} -k graceful-stop";
776
-
ExecReload = "${pkg}/bin/httpd -f ${httpdConf} -k graceful";
775
+
ExecStart = "@${pkg}/bin/httpd httpd -f /etc/httpd/httpd.conf";
776
+
ExecStop = "${pkg}/bin/httpd -f /etc/httpd/httpd.conf -k graceful-stop";
777
+
ExecReload = "${pkg}/bin/httpd -f /etc/httpd/httpd.conf -k graceful";
···
# certs are updated _after_ config has been reloaded.
804
+
restartTriggers = [ cfg.configFile ];
# Block reloading if not all certs exist yet.
# Happens when config changes add new vhosts/certs.
unitConfig.ConditionPathExists = map (certName: certs.${certName}.directory + "/fullchain.pem") dependentCertNames;
···
ExecCondition = "/run/current-system/systemd/bin/systemctl -q is-active httpd.service";
810
-
ExecStartPre = "${pkg}/bin/httpd -f ${httpdConf} -t";
812
+
ExecStartPre = "${pkg}/bin/httpd -f /etc/httpd/httpd.conf -t";
ExecStart = "/run/current-system/systemd/bin/systemctl reload httpd.service";