aboutsummaryrefslogtreecommitdiff
path: root/nixops
diff options
context:
space:
mode:
Diffstat (limited to 'nixops')
-rw-r--r--nixops/modules/websites/apache/httpd_inte.nix23
-rw-r--r--nixops/modules/websites/apache/httpd_prod.nix23
-rw-r--r--nixops/modules/websites/apache/httpd_tools.nix23
3 files changed, 36 insertions, 33 deletions
diff --git a/nixops/modules/websites/apache/httpd_inte.nix b/nixops/modules/websites/apache/httpd_inte.nix
index ee7d15e..5046a28 100644
--- a/nixops/modules/websites/apache/httpd_inte.nix
+++ b/nixops/modules/websites/apache/httpd_inte.nix
@@ -151,7 +151,7 @@ let
151 151
152 152
153 loggingConf = (if mainCfg.logFormat != "none" then '' 153 loggingConf = (if mainCfg.logFormat != "none" then ''
154 ErrorLog ${mainCfg.logDir}/error_log 154 ErrorLog ${mainCfg.logDir}/error.log
155 155
156 LogLevel notice 156 LogLevel notice
157 157
@@ -160,7 +160,7 @@ let
160 LogFormat "%{Referer}i -> %U" referer 160 LogFormat "%{Referer}i -> %U" referer
161 LogFormat "%{User-agent}i" agent 161 LogFormat "%{User-agent}i" agent
162 162
163 CustomLog ${mainCfg.logDir}/access_log ${mainCfg.logFormat} 163 CustomLog ${mainCfg.logDir}/access.log ${mainCfg.logFormat}
164 '' else '' 164 '' else ''
165 ErrorLog /dev/null 165 ErrorLog /dev/null
166 ''); 166 '');
@@ -261,8 +261,8 @@ let
261 '' else ""} 261 '' else ""}
262 262
263 ${if !isMainServer && mainCfg.logPerVirtualHost then '' 263 ${if !isMainServer && mainCfg.logPerVirtualHost then ''
264 ErrorLog ${mainCfg.logDir}/error_log-${cfg.hostName} 264 ErrorLog ${mainCfg.logDir}/error-${cfg.hostName}.log
265 CustomLog ${mainCfg.logDir}/access_log-${cfg.hostName} ${cfg.logFormat} 265 CustomLog ${mainCfg.logDir}/access-${cfg.hostName}.log ${cfg.logFormat}
266 '' else ""} 266 '' else ""}
267 267
268 ${optionalString (robotsTxt != "") '' 268 ${optionalString (robotsTxt != "") ''
@@ -419,6 +419,7 @@ let
419 phpIni = pkgs.runCommand "php.ini" 419 phpIni = pkgs.runCommand "php.ini"
420 { options = concatStringsSep "\n" 420 { options = concatStringsSep "\n"
421 ([ mainCfg.phpOptions ] ++ (map (svc: svc.phpOptions) allSubservices)); 421 ([ mainCfg.phpOptions ] ++ (map (svc: svc.phpOptions) allSubservices));
422 preferLocalBuild = true;
422 } 423 }
423 '' 424 ''
424 cat ${php}/etc/php.ini > $out 425 cat ${php}/etc/php.ini > $out
@@ -490,8 +491,8 @@ in
490 default = false; 491 default = false;
491 description = '' 492 description = ''
492 If enabled, each virtual host gets its own 493 If enabled, each virtual host gets its own
493 <filename>access_log</filename> and 494 <filename>access.log</filename> and
494 <filename>error_log</filename>, namely suffixed by the 495 <filename>error.log</filename>, namely suffixed by the
495 <option>hostName</option> of the virtual host. 496 <option>hostName</option> of the virtual host.
496 ''; 497 '';
497 }; 498 };
@@ -534,7 +535,7 @@ in
534 535
535 virtualHosts = mkOption { 536 virtualHosts = mkOption {
536 type = types.listOf (types.submodule ( 537 type = types.listOf (types.submodule (
537 { options = import ./per-server-options.nix { 538 { options = import <nixpkgs/nixos/modules/services/web-servers/apache-httpd/per-server-options.nix> {
538 inherit lib; 539 inherit lib;
539 forMainServer = false; 540 forMainServer = false;
540 }; 541 };
@@ -667,6 +668,9 @@ in
667 '' 668 ''
668 ; Needed for PHP's mail() function. 669 ; Needed for PHP's mail() function.
669 sendmail_path = sendmail -t -i 670 sendmail_path = sendmail -t -i
671
672 ; Don't advertise PHP
673 expose_php = off
670 '' + optionalString (!isNull config.time.timeZone) '' 674 '' + optionalString (!isNull config.time.timeZone) ''
671 675
672 ; Apparently PHP doesn't use $TZ. 676 ; Apparently PHP doesn't use $TZ.
@@ -682,10 +686,7 @@ in
682 686
683 path = 687 path =
684 [ httpd pkgs.coreutils pkgs.gnugrep ] 688 [ httpd pkgs.coreutils pkgs.gnugrep ]
685 ++ # Needed for PHP's mail() function. !!! Probably the 689 ++ optional enablePHP pkgs.system-sendmail # Needed for PHP's mail() function.
686 # ssmtp module should export the path to sendmail in
687 # some way.
688 optional config.networking.defaultMailServer.directDelivery pkgs.ssmtp
689 ++ concatMap (svc: svc.extraServerPath) allSubservices; 690 ++ concatMap (svc: svc.extraServerPath) allSubservices;
690 691
691 environment = 692 environment =
diff --git a/nixops/modules/websites/apache/httpd_prod.nix b/nixops/modules/websites/apache/httpd_prod.nix
index 31904e0..4b646f5 100644
--- a/nixops/modules/websites/apache/httpd_prod.nix
+++ b/nixops/modules/websites/apache/httpd_prod.nix
@@ -151,7 +151,7 @@ let
151 151
152 152
153 loggingConf = (if mainCfg.logFormat != "none" then '' 153 loggingConf = (if mainCfg.logFormat != "none" then ''
154 ErrorLog ${mainCfg.logDir}/error_log 154 ErrorLog ${mainCfg.logDir}/error.log
155 155
156 LogLevel notice 156 LogLevel notice
157 157
@@ -160,7 +160,7 @@ let
160 LogFormat "%{Referer}i -> %U" referer 160 LogFormat "%{Referer}i -> %U" referer
161 LogFormat "%{User-agent}i" agent 161 LogFormat "%{User-agent}i" agent
162 162
163 CustomLog ${mainCfg.logDir}/access_log ${mainCfg.logFormat} 163 CustomLog ${mainCfg.logDir}/access.log ${mainCfg.logFormat}
164 '' else '' 164 '' else ''
165 ErrorLog /dev/null 165 ErrorLog /dev/null
166 ''); 166 '');
@@ -261,8 +261,8 @@ let
261 '' else ""} 261 '' else ""}
262 262
263 ${if !isMainServer && mainCfg.logPerVirtualHost then '' 263 ${if !isMainServer && mainCfg.logPerVirtualHost then ''
264 ErrorLog ${mainCfg.logDir}/error_log-${cfg.hostName} 264 ErrorLog ${mainCfg.logDir}/error-${cfg.hostName}.log
265 CustomLog ${mainCfg.logDir}/access_log-${cfg.hostName} ${cfg.logFormat} 265 CustomLog ${mainCfg.logDir}/access-${cfg.hostName}.log ${cfg.logFormat}
266 '' else ""} 266 '' else ""}
267 267
268 ${optionalString (robotsTxt != "") '' 268 ${optionalString (robotsTxt != "") ''
@@ -419,6 +419,7 @@ let
419 phpIni = pkgs.runCommand "php.ini" 419 phpIni = pkgs.runCommand "php.ini"
420 { options = concatStringsSep "\n" 420 { options = concatStringsSep "\n"
421 ([ mainCfg.phpOptions ] ++ (map (svc: svc.phpOptions) allSubservices)); 421 ([ mainCfg.phpOptions ] ++ (map (svc: svc.phpOptions) allSubservices));
422 preferLocalBuild = true;
422 } 423 }
423 '' 424 ''
424 cat ${php}/etc/php.ini > $out 425 cat ${php}/etc/php.ini > $out
@@ -490,8 +491,8 @@ in
490 default = false; 491 default = false;
491 description = '' 492 description = ''
492 If enabled, each virtual host gets its own 493 If enabled, each virtual host gets its own
493 <filename>access_log</filename> and 494 <filename>access.log</filename> and
494 <filename>error_log</filename>, namely suffixed by the 495 <filename>error.log</filename>, namely suffixed by the
495 <option>hostName</option> of the virtual host. 496 <option>hostName</option> of the virtual host.
496 ''; 497 '';
497 }; 498 };
@@ -534,7 +535,7 @@ in
534 535
535 virtualHosts = mkOption { 536 virtualHosts = mkOption {
536 type = types.listOf (types.submodule ( 537 type = types.listOf (types.submodule (
537 { options = import ./per-server-options.nix { 538 { options = import <nixpkgs/nixos/modules/services/web-servers/apache-httpd/per-server-options.nix> {
538 inherit lib; 539 inherit lib;
539 forMainServer = false; 540 forMainServer = false;
540 }; 541 };
@@ -667,6 +668,9 @@ in
667 '' 668 ''
668 ; Needed for PHP's mail() function. 669 ; Needed for PHP's mail() function.
669 sendmail_path = sendmail -t -i 670 sendmail_path = sendmail -t -i
671
672 ; Don't advertise PHP
673 expose_php = off
670 '' + optionalString (!isNull config.time.timeZone) '' 674 '' + optionalString (!isNull config.time.timeZone) ''
671 675
672 ; Apparently PHP doesn't use $TZ. 676 ; Apparently PHP doesn't use $TZ.
@@ -682,10 +686,7 @@ in
682 686
683 path = 687 path =
684 [ httpd pkgs.coreutils pkgs.gnugrep ] 688 [ httpd pkgs.coreutils pkgs.gnugrep ]
685 ++ # Needed for PHP's mail() function. !!! Probably the 689 ++ optional enablePHP pkgs.system-sendmail # Needed for PHP's mail() function.
686 # ssmtp module should export the path to sendmail in
687 # some way.
688 optional config.networking.defaultMailServer.directDelivery pkgs.ssmtp
689 ++ concatMap (svc: svc.extraServerPath) allSubservices; 690 ++ concatMap (svc: svc.extraServerPath) allSubservices;
690 691
691 environment = 692 environment =
diff --git a/nixops/modules/websites/apache/httpd_tools.nix b/nixops/modules/websites/apache/httpd_tools.nix
index 1b9d1e3..c48d0d2 100644
--- a/nixops/modules/websites/apache/httpd_tools.nix
+++ b/nixops/modules/websites/apache/httpd_tools.nix
@@ -151,7 +151,7 @@ let
151 151
152 152
153 loggingConf = (if mainCfg.logFormat != "none" then '' 153 loggingConf = (if mainCfg.logFormat != "none" then ''
154 ErrorLog ${mainCfg.logDir}/error_log 154 ErrorLog ${mainCfg.logDir}/error.log
155 155
156 LogLevel notice 156 LogLevel notice
157 157
@@ -160,7 +160,7 @@ let
160 LogFormat "%{Referer}i -> %U" referer 160 LogFormat "%{Referer}i -> %U" referer
161 LogFormat "%{User-agent}i" agent 161 LogFormat "%{User-agent}i" agent
162 162
163 CustomLog ${mainCfg.logDir}/access_log ${mainCfg.logFormat} 163 CustomLog ${mainCfg.logDir}/access.log ${mainCfg.logFormat}
164 '' else '' 164 '' else ''
165 ErrorLog /dev/null 165 ErrorLog /dev/null
166 ''); 166 '');
@@ -261,8 +261,8 @@ let
261 '' else ""} 261 '' else ""}
262 262
263 ${if !isMainServer && mainCfg.logPerVirtualHost then '' 263 ${if !isMainServer && mainCfg.logPerVirtualHost then ''
264 ErrorLog ${mainCfg.logDir}/error_log-${cfg.hostName} 264 ErrorLog ${mainCfg.logDir}/error-${cfg.hostName}.log
265 CustomLog ${mainCfg.logDir}/access_log-${cfg.hostName} ${cfg.logFormat} 265 CustomLog ${mainCfg.logDir}/access-${cfg.hostName}.log ${cfg.logFormat}
266 '' else ""} 266 '' else ""}
267 267
268 ${optionalString (robotsTxt != "") '' 268 ${optionalString (robotsTxt != "") ''
@@ -419,6 +419,7 @@ let
419 phpIni = pkgs.runCommand "php.ini" 419 phpIni = pkgs.runCommand "php.ini"
420 { options = concatStringsSep "\n" 420 { options = concatStringsSep "\n"
421 ([ mainCfg.phpOptions ] ++ (map (svc: svc.phpOptions) allSubservices)); 421 ([ mainCfg.phpOptions ] ++ (map (svc: svc.phpOptions) allSubservices));
422 preferLocalBuild = true;
422 } 423 }
423 '' 424 ''
424 cat ${php}/etc/php.ini > $out 425 cat ${php}/etc/php.ini > $out
@@ -490,8 +491,8 @@ in
490 default = false; 491 default = false;
491 description = '' 492 description = ''
492 If enabled, each virtual host gets its own 493 If enabled, each virtual host gets its own
493 <filename>access_log</filename> and 494 <filename>access.log</filename> and
494 <filename>error_log</filename>, namely suffixed by the 495 <filename>error.log</filename>, namely suffixed by the
495 <option>hostName</option> of the virtual host. 496 <option>hostName</option> of the virtual host.
496 ''; 497 '';
497 }; 498 };
@@ -534,7 +535,7 @@ in
534 535
535 virtualHosts = mkOption { 536 virtualHosts = mkOption {
536 type = types.listOf (types.submodule ( 537 type = types.listOf (types.submodule (
537 { options = import ./per-server-options.nix { 538 { options = import <nixpkgs/nixos/modules/services/web-servers/apache-httpd/per-server-options.nix> {
538 inherit lib; 539 inherit lib;
539 forMainServer = false; 540 forMainServer = false;
540 }; 541 };
@@ -679,6 +680,9 @@ in
679 '' 680 ''
680 ; Needed for PHP's mail() function. 681 ; Needed for PHP's mail() function.
681 sendmail_path = sendmail -t -i 682 sendmail_path = sendmail -t -i
683
684 ; Don't advertise PHP
685 expose_php = off
682 '' + optionalString (!isNull config.time.timeZone) '' 686 '' + optionalString (!isNull config.time.timeZone) ''
683 687
684 ; Apparently PHP doesn't use $TZ. 688 ; Apparently PHP doesn't use $TZ.
@@ -694,10 +698,7 @@ in
694 698
695 path = 699 path =
696 [ httpd pkgs.coreutils pkgs.gnugrep ] 700 [ httpd pkgs.coreutils pkgs.gnugrep ]
697 ++ # Needed for PHP's mail() function. !!! Probably the 701 ++ optional enablePHP pkgs.system-sendmail # Needed for PHP's mail() function.
698 # ssmtp module should export the path to sendmail in
699 # some way.
700 optional config.networking.defaultMailServer.directDelivery pkgs.ssmtp
701 ++ concatMap (svc: svc.extraServerPath) allSubservices; 702 ++ concatMap (svc: svc.extraServerPath) allSubservices;
702 703
703 environment = 704 environment =