diff --git a/install/sql/incremental/upd_dev_collection.sql b/install/sql/incremental/upd_dev_collection.sql index dc695b7a4aa273c7673ba394ddc9b23e108e526a..1ccef0797d7b6c0847d8b2669223ccfee65652a4 100644 --- a/install/sql/incremental/upd_dev_collection.sql +++ b/install/sql/incremental/upd_dev_collection.sql @@ -1 +1,2 @@ -ALTER TABLE `web_domain` CHANGE `folder_directive_snippets` `folder_directive_snippets` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL; \ No newline at end of file +ALTER TABLE `web_domain` CHANGE `folder_directive_snippets` `folder_directive_snippets` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL; +ALTER TABLE `web_domain` ADD `log_retention` INT NOT NULL DEFAULT '30' AFTER `https_port`; diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql index 1934cd8957448053990a71608cd24440bba69ba6..f2f497ae10ff4acda8670daa61d788263d7ff4e0 100644 --- a/install/sql/ispconfig3.sql +++ b/install/sql/ispconfig3.sql @@ -1986,6 +1986,7 @@ CREATE TABLE `web_domain` ( `http_port` int(11) unsigned NOT NULL DEFAULT '80', `https_port` int(11) unsigned NOT NULL DEFAULT '443', `folder_directive_snippets` text, + `log_retention` int(11) NOT NULL DEFAULT '30', PRIMARY KEY (`domain_id`), UNIQUE KEY `serverdomain` ( `server_id` , `ip_address`, `domain` ) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; diff --git a/interface/web/sites/form/web_vhost_domain.tform.php b/interface/web/sites/form/web_vhost_domain.tform.php index 923e73b2b041d44c22b62a1c190196a6703a7823..042fca8f1bf600ee9cb2cf75772e061c9237b7ac 100644 --- a/interface/web/sites/form/web_vhost_domain.tform.php +++ b/interface/web/sites/form/web_vhost_domain.tform.php @@ -917,7 +917,19 @@ if($_SESSION["s"]["user"]["typ"] == 'admin' 'value' => '', 'width' => '3', 'maxlength' => '6' - ) + ), + 'log_retention' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^([0-9]{1,4})$/', + 'errmsg'=> 'log_retention_error_regex'), + ), + 'default' => '30', + 'value' => '', + 'width' => '4', + 'maxlength' => '4' + ) //################################# // ENDE Datatable fields //################################# diff --git a/interface/web/sites/lib/lang/ar_web_vhost_domain.lng b/interface/web/sites/lib/lang/ar_web_vhost_domain.lng index 94c79285a22a42981bd842388a0dd24c9de9e742..41f4eb9bb1f21761774069477e28370445dfb01e 100644 --- a/interface/web/sites/lib/lang/ar_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/ar_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/bg_web_vhost_domain.lng b/interface/web/sites/lib/lang/bg_web_vhost_domain.lng index 227f59a2b98b9a54e229308b4188bbd1f3459ac5..2da107636ca51e9206b69a989ba879c2f26826c6 100644 --- a/interface/web/sites/lib/lang/bg_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/bg_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/br_web_vhost_domain.lng b/interface/web/sites/lib/lang/br_web_vhost_domain.lng index d23d6e42f82707c55c94f7aae5faad58fd03bbd4..ef6ceeaada73809b19dc0cd17f8b78847c1dbef4 100644 --- a/interface/web/sites/lib/lang/br_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/br_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'Porta HTTPS'; $wb['http_port_error_regex'] = 'Porta HTTP inválida.'; $wb['https_port_error_regex'] = 'Porta HTTPS inválida.'; $wb['enable_pagespeed_txt'] = 'Habilitar PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/ca_web_vhost_domain.lng b/interface/web/sites/lib/lang/ca_web_vhost_domain.lng index f556ac53ae1abdbb20c65d4fcbc18db3c495e90b..43a58b0dd1e65434b6c643d0aba3636b6cad7675 100644 --- a/interface/web/sites/lib/lang/ca_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/ca_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/cz_web_vhost_domain.lng b/interface/web/sites/lib/lang/cz_web_vhost_domain.lng index 9904babdba08f6723ba6cc237f160d934f612dee..a278776629ca75b43d93f9f42b62d171faa2f1db 100644 --- a/interface/web/sites/lib/lang/cz_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/cz_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/de_web_vhost_domain.lng b/interface/web/sites/lib/lang/de_web_vhost_domain.lng index 5a732471891043a43cef47650b8947ca9eb4c1d9..1b86171ea7a3ea7c27833c4a9a477caade0c8e77 100644 --- a/interface/web/sites/lib/lang/de_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/de_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Log-Dateien Aufbewahrungszeit'; +$wb['log_retention_error_regex'] = "Aufbewahrungszeit in Tagen (Erlaubte Werte: min. 0 - max. 9999)"; ?> diff --git a/interface/web/sites/lib/lang/dk_web_vhost_domain.lng b/interface/web/sites/lib/lang/dk_web_vhost_domain.lng index f556ac53ae1abdbb20c65d4fcbc18db3c495e90b..43a58b0dd1e65434b6c643d0aba3636b6cad7675 100644 --- a/interface/web/sites/lib/lang/dk_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/dk_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/el_web_vhost_domain.lng b/interface/web/sites/lib/lang/el_web_vhost_domain.lng index 667e0bb6ec5aec7254f7c9228b678f420cb06d3a..66d8f33a16a093809b45c5c0da56899deadb047d 100644 --- a/interface/web/sites/lib/lang/el_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/el_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/en_web_vhost_domain.lng b/interface/web/sites/lib/lang/en_web_vhost_domain.lng index 23da049a955ced568478dd9a74c709365658abeb..4d7b32015155c5f35403e2f5cdaa7a118db69339 100644 --- a/interface/web/sites/lib/lang/en_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/en_web_vhost_domain.lng @@ -153,4 +153,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/es_web_vhost_domain.lng b/interface/web/sites/lib/lang/es_web_vhost_domain.lng index 8d890db4a41b3f400dcca3101575022340d2e9e9..432dd843410e2efd3c1ef63e1bf340dbdbe15729 100644 --- a/interface/web/sites/lib/lang/es_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/es_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/fi_web_vhost_domain.lng b/interface/web/sites/lib/lang/fi_web_vhost_domain.lng index 22b75c84af1e7d59e98b5a6ddedb342fd0ed6d1f..f2de0000a0db169ab3c30a08caebd649306d79e3 100644 --- a/interface/web/sites/lib/lang/fi_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/fi_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/fr_web_vhost_domain.lng b/interface/web/sites/lib/lang/fr_web_vhost_domain.lng index 9e88ec533f5f74eb54bc2ba65622efaa197e0fad..eb1bb82750cba95b5e98781cfcfa7a62492c412e 100644 --- a/interface/web/sites/lib/lang/fr_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/fr_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/hr_web_vhost_domain.lng b/interface/web/sites/lib/lang/hr_web_vhost_domain.lng index eac61086d542ae8306720720d047f910e7d064e7..7262c6f85850de5b762e5177fa8da470896a143f 100644 --- a/interface/web/sites/lib/lang/hr_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/hr_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/hu_web_vhost_domain.lng b/interface/web/sites/lib/lang/hu_web_vhost_domain.lng index e7adff96e8411b9db936dde50ba848eae13d5b76..e10f791710b0593d0116ca75f5e22f0a272003ac 100644 --- a/interface/web/sites/lib/lang/hu_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/hu_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/id_web_vhost_domain.lng b/interface/web/sites/lib/lang/id_web_vhost_domain.lng index b334c4f6a3bb671f0e1e38071b70fa67f6d1fb30..0cd28efa96b3f3b3fe7613e7626ea5e5cffff4eb 100644 --- a/interface/web/sites/lib/lang/id_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/id_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/it_web_vhost_domain.lng b/interface/web/sites/lib/lang/it_web_vhost_domain.lng index 1b31e12c22e5df82f22cd98062e7eb87d6eb0f2f..73b7b4d352180bc716a8d8fc0c4233308ea41103 100644 --- a/interface/web/sites/lib/lang/it_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/it_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/ja_web_vhost_domain.lng b/interface/web/sites/lib/lang/ja_web_vhost_domain.lng index 6a68440cd62c12b9a84ecdb2970e1623433db4e1..47d7a154f19de5a8f3a9dc609bcc1628f26e8b61 100644 --- a/interface/web/sites/lib/lang/ja_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/ja_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/nl_web_vhost_domain.lng b/interface/web/sites/lib/lang/nl_web_vhost_domain.lng index 9f384bb2f818674bc74a30775877519572ff42a8..227eb70d21110ea0bd3174e5c7828c45bdc15266 100644 --- a/interface/web/sites/lib/lang/nl_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/nl_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Poort'; $wb['http_port_error_regex'] = 'HTTP Poort niet correct.'; $wb['https_port_error_regex'] = 'HTTPS Poort niet correct.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/pl_web_vhost_domain.lng b/interface/web/sites/lib/lang/pl_web_vhost_domain.lng index e7556d430bbf9ea18fb7a602cd14d9e0ed359762..3ccd645c32d4c6e5d159bf3dd6f3e5460ae86318 100644 --- a/interface/web/sites/lib/lang/pl_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/pl_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/pt_web_vhost_domain.lng b/interface/web/sites/lib/lang/pt_web_vhost_domain.lng index 183d9d909478f99fe2416b7c126200649f03be43..4ff1e7c4252101f4ec762bea8c594f939b0c2886 100644 --- a/interface/web/sites/lib/lang/pt_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/pt_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/ro_web_vhost_domain.lng b/interface/web/sites/lib/lang/ro_web_vhost_domain.lng index 0f26be9547ef613aa5f137ba91517c65112c44a1..fc10154df554189effef1c9f2d30a7ee415154a2 100644 --- a/interface/web/sites/lib/lang/ro_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/ro_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/se_web_vhost_domain.lng b/interface/web/sites/lib/lang/se_web_vhost_domain.lng index a43688f27ee4fcd7ebee22cc5df1f8861ba58fd0..b8dae2f09a640e81d9c2eabbfd929f7415e69cf4 100644 --- a/interface/web/sites/lib/lang/se_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/se_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/sk_web_vhost_domain.lng b/interface/web/sites/lib/lang/sk_web_vhost_domain.lng index d95787116aa3478aaab1da81ed12f3104b221d57..140835db84c53c8efabe363378b725dba6f1acec 100644 --- a/interface/web/sites/lib/lang/sk_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/sk_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/lib/lang/tr_web_vhost_domain.lng b/interface/web/sites/lib/lang/tr_web_vhost_domain.lng index 6bf33db68f3ea93b34618a6758c6807df0f53900..e2676913bf7a389118525ff17f10b8327450f2a4 100644 --- a/interface/web/sites/lib/lang/tr_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/tr_web_vhost_domain.lng @@ -148,4 +148,6 @@ $wb['https_port_txt'] = 'HTTPS Port'; $wb['http_port_error_regex'] = 'HTTP Port invalid.'; $wb['https_port_error_regex'] = 'HTTPS Port invalid.'; $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; +$wb['log_retention_txt'] = 'Logfiles retention time'; +$wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; ?> diff --git a/interface/web/sites/templates/web_vhost_domain_advanced.htm b/interface/web/sites/templates/web_vhost_domain_advanced.htm index 2ef8c7daf47d95db61f38b1e6771cdd2cb572b98..7ca4710f404328e6e0b857f87ad7d766120efab1 100644 --- a/interface/web/sites/templates/web_vhost_domain_advanced.htm +++ b/interface/web/sites/templates/web_vhost_domain_advanced.htm @@ -35,6 +35,10 @@ +
+ +
+
diff --git a/server/lib/classes/cron.d/200-logfiles.inc.php b/server/lib/classes/cron.d/200-logfiles.inc.php index 98dd662f696f636e6e33a217e39ba19894284fc2..97f6c77f413887d0e404e309e7b7646fca748da4 100644 --- a/server/lib/classes/cron.d/200-logfiles.inc.php +++ b/server/lib/classes/cron.d/200-logfiles.inc.php @@ -60,7 +60,7 @@ class cronjob_logfiles extends cronjob { // Manage and compress web logfiles and create traffic statistics //###################################################################################################### - $sql = "SELECT domain_id, domain, type, document_root, web_folder, parent_domain_id FROM web_domain WHERE (type = 'vhost' or type = 'vhostsubdomain' or type = 'vhostalias') AND server_id = ?"; + $sql = "SELECT domain_id, domain, type, document_root, web_folder, parent_domain_id, log_retention FROM web_domain WHERE (type = 'vhost' or type = 'vhostsubdomain' or type = 'vhostalias') AND server_id = ?"; $records = $app->db->queryAllRecords($sql, $conf['server_id']); foreach($records as $rec) { @@ -76,6 +76,8 @@ class cronjob_logfiles extends cronjob { unset($tmp); } + $log_retention = $rec['log_retention']; + $logfile = $rec['document_root'].'/' . $log_folder . '/'.$yesterday.'-access.log'; $total_bytes = 0; @@ -142,21 +144,17 @@ class cronjob_logfiles extends cronjob { exec("cat /dev/null > $logfile"); } - // delete logfiles after 30 days - $month_ago = date('Ymd', time() - 86400 * 30); - $logfile = escapeshellcmd($rec['document_root'].'/' . $log_folder . '/'.$month_ago.'-access.log.gz'); - if(@is_file($logfile)) { - unlink($logfile); - } - - //* Delete older Log files, in case that we missed them before due to serverdowntimes. - $datepart = date('Ym', time() - 86400 * 31 * 2); + // delete logfiles after x days (default 30) + if($log_retention > 0) { + foreach (glob($rec['document_root'].'/' . $log_folder . '/'."*.log*") as $logfile) { + $now = time(); + if (is_file($logfile)) + if ($now - filemtime($logfile) >= 60 * 60 * 24 * $log_retention) + unlink($logfile); + } - $logfile = escapeshellcmd($rec['document_root']).'/' . $log_folder . '/'.$datepart.'*-access.log.gz'; - exec('rm -f '.$logfile); + } - $logfile = escapeshellcmd($rec['document_root']).'/' . $log_folder . '/'.$datepart.'*-access.log'; - exec('rm -f '.$logfile); } //* Delete old logfiles in /var/log/ispconfig/httpd/ that were created by vlogger for the hostname of the server