trap "rm -f $TMPFILE" EXIT
mkdir -p ${cfg.dataDir}/${domain}
- cat /var/log/httpd/access_log-${domain} | sed -n "/\\[$date_regex/ p" > $TMPFILE
- for i in /var/log/httpd/access_log-${domain}*.gz; do
+ cat /var/log/httpd/access-${domain}.log | sed -n "/\\[$date_regex/ p" > $TMPFILE
+ for i in /var/log/httpd/access-${domain}*.gz; do
zcat "$i" | sed -n "/\\[$date_regex/ p" >> $TMPFILE
done
${pkgs.goaccess}/bin/goaccess $TMPFILE --no-progress -o ${cfg.dataDir}/${domain}/index.html -p ${config}
loggingConf = (if mainCfg.logFormat != "none" then ''
- ErrorLog ${mainCfg.logDir}/error_log
+ ErrorLog ${mainCfg.logDir}/error.log
LogLevel notice
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
- CustomLog ${mainCfg.logDir}/access_log ${mainCfg.logFormat}
+ CustomLog ${mainCfg.logDir}/access.log ${mainCfg.logFormat}
'' else ''
ErrorLog /dev/null
'');
'' else ""}
${if !isMainServer && mainCfg.logPerVirtualHost then ''
- ErrorLog ${mainCfg.logDir}/error_log-${cfg.hostName}
- CustomLog ${mainCfg.logDir}/access_log-${cfg.hostName} ${cfg.logFormat}
+ ErrorLog ${mainCfg.logDir}/error-${cfg.hostName}.log
+ CustomLog ${mainCfg.logDir}/access-${cfg.hostName}.log ${cfg.logFormat}
'' else ""}
${optionalString (robotsTxt != "") ''
phpIni = pkgs.runCommand "php.ini"
{ options = concatStringsSep "\n"
([ mainCfg.phpOptions ] ++ (map (svc: svc.phpOptions) allSubservices));
+ preferLocalBuild = true;
}
''
cat ${php}/etc/php.ini > $out
default = false;
description = ''
If enabled, each virtual host gets its own
- <filename>access_log</filename> and
- <filename>error_log</filename>, namely suffixed by the
+ <filename>access.log</filename> and
+ <filename>error.log</filename>, namely suffixed by the
<option>hostName</option> of the virtual host.
'';
};
virtualHosts = mkOption {
type = types.listOf (types.submodule (
- { options = import ./per-server-options.nix {
+ { options = import <nixpkgs/nixos/modules/services/web-servers/apache-httpd/per-server-options.nix> {
inherit lib;
forMainServer = false;
};
''
; Needed for PHP's mail() function.
sendmail_path = sendmail -t -i
+
+ ; Don't advertise PHP
+ expose_php = off
'' + optionalString (!isNull config.time.timeZone) ''
; Apparently PHP doesn't use $TZ.
path =
[ httpd pkgs.coreutils pkgs.gnugrep ]
- ++ # Needed for PHP's mail() function. !!! Probably the
- # ssmtp module should export the path to sendmail in
- # some way.
- optional config.networking.defaultMailServer.directDelivery pkgs.ssmtp
+ ++ optional enablePHP pkgs.system-sendmail # Needed for PHP's mail() function.
++ concatMap (svc: svc.extraServerPath) allSubservices;
environment =
loggingConf = (if mainCfg.logFormat != "none" then ''
- ErrorLog ${mainCfg.logDir}/error_log
+ ErrorLog ${mainCfg.logDir}/error.log
LogLevel notice
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
- CustomLog ${mainCfg.logDir}/access_log ${mainCfg.logFormat}
+ CustomLog ${mainCfg.logDir}/access.log ${mainCfg.logFormat}
'' else ''
ErrorLog /dev/null
'');
'' else ""}
${if !isMainServer && mainCfg.logPerVirtualHost then ''
- ErrorLog ${mainCfg.logDir}/error_log-${cfg.hostName}
- CustomLog ${mainCfg.logDir}/access_log-${cfg.hostName} ${cfg.logFormat}
+ ErrorLog ${mainCfg.logDir}/error-${cfg.hostName}.log
+ CustomLog ${mainCfg.logDir}/access-${cfg.hostName}.log ${cfg.logFormat}
'' else ""}
${optionalString (robotsTxt != "") ''
phpIni = pkgs.runCommand "php.ini"
{ options = concatStringsSep "\n"
([ mainCfg.phpOptions ] ++ (map (svc: svc.phpOptions) allSubservices));
+ preferLocalBuild = true;
}
''
cat ${php}/etc/php.ini > $out
default = false;
description = ''
If enabled, each virtual host gets its own
- <filename>access_log</filename> and
- <filename>error_log</filename>, namely suffixed by the
+ <filename>access.log</filename> and
+ <filename>error.log</filename>, namely suffixed by the
<option>hostName</option> of the virtual host.
'';
};
virtualHosts = mkOption {
type = types.listOf (types.submodule (
- { options = import ./per-server-options.nix {
+ { options = import <nixpkgs/nixos/modules/services/web-servers/apache-httpd/per-server-options.nix> {
inherit lib;
forMainServer = false;
};
''
; Needed for PHP's mail() function.
sendmail_path = sendmail -t -i
+
+ ; Don't advertise PHP
+ expose_php = off
'' + optionalString (!isNull config.time.timeZone) ''
; Apparently PHP doesn't use $TZ.
path =
[ httpd pkgs.coreutils pkgs.gnugrep ]
- ++ # Needed for PHP's mail() function. !!! Probably the
- # ssmtp module should export the path to sendmail in
- # some way.
- optional config.networking.defaultMailServer.directDelivery pkgs.ssmtp
+ ++ optional enablePHP pkgs.system-sendmail # Needed for PHP's mail() function.
++ concatMap (svc: svc.extraServerPath) allSubservices;
environment =
loggingConf = (if mainCfg.logFormat != "none" then ''
- ErrorLog ${mainCfg.logDir}/error_log
+ ErrorLog ${mainCfg.logDir}/error.log
LogLevel notice
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
- CustomLog ${mainCfg.logDir}/access_log ${mainCfg.logFormat}
+ CustomLog ${mainCfg.logDir}/access.log ${mainCfg.logFormat}
'' else ''
ErrorLog /dev/null
'');
'' else ""}
${if !isMainServer && mainCfg.logPerVirtualHost then ''
- ErrorLog ${mainCfg.logDir}/error_log-${cfg.hostName}
- CustomLog ${mainCfg.logDir}/access_log-${cfg.hostName} ${cfg.logFormat}
+ ErrorLog ${mainCfg.logDir}/error-${cfg.hostName}.log
+ CustomLog ${mainCfg.logDir}/access-${cfg.hostName}.log ${cfg.logFormat}
'' else ""}
${optionalString (robotsTxt != "") ''
phpIni = pkgs.runCommand "php.ini"
{ options = concatStringsSep "\n"
([ mainCfg.phpOptions ] ++ (map (svc: svc.phpOptions) allSubservices));
+ preferLocalBuild = true;
}
''
cat ${php}/etc/php.ini > $out
default = false;
description = ''
If enabled, each virtual host gets its own
- <filename>access_log</filename> and
- <filename>error_log</filename>, namely suffixed by the
+ <filename>access.log</filename> and
+ <filename>error.log</filename>, namely suffixed by the
<option>hostName</option> of the virtual host.
'';
};
virtualHosts = mkOption {
type = types.listOf (types.submodule (
- { options = import ./per-server-options.nix {
+ { options = import <nixpkgs/nixos/modules/services/web-servers/apache-httpd/per-server-options.nix> {
inherit lib;
forMainServer = false;
};
''
; Needed for PHP's mail() function.
sendmail_path = sendmail -t -i
+
+ ; Don't advertise PHP
+ expose_php = off
'' + optionalString (!isNull config.time.timeZone) ''
; Apparently PHP doesn't use $TZ.
path =
[ httpd pkgs.coreutils pkgs.gnugrep ]
- ++ # Needed for PHP's mail() function. !!! Probably the
- # ssmtp module should export the path to sendmail in
- # some way.
- optional config.networking.defaultMailServer.directDelivery pkgs.ssmtp
+ ++ optional enablePHP pkgs.system-sendmail # Needed for PHP's mail() function.
++ concatMap (svc: svc.extraServerPath) allSubservices;
environment =