diff --git a/install/tpl/server.ini.master b/install/tpl/server.ini.master index 747b9c69421f5d544c720c854d352518ccf4e4e2..cfddc494fe0994940730958ee10af449c38a5150 100644 --- a/install/tpl/server.ini.master +++ b/install/tpl/server.ini.master @@ -49,7 +49,7 @@ htaccess_allow_override=All awstats_conf_dir=/etc/awstats awstats_data_dir=/var/lib/awstats awstats_pl=/usr/lib/cgi-bin/awstats.pl -awstats_updateall_pl=/usr/share/doc/awstats/examples/awstats_updateall.pl +awstats_buildstaticpages_pl=/usr/share/awstats/tools/awstats_buildstaticpages.pl [dns] bind_user=root diff --git a/interface/web/admin/form/server_config.tform.php b/interface/web/admin/form/server_config.tform.php index 15415aa5105c926e1786ec64357b937fd1048f47..5ebb88d0c375a5c7c1f4adcea0e678dacf2165b0 100644 --- a/interface/web/admin/form/server_config.tform.php +++ b/interface/web/admin/form/server_config.tform.php @@ -463,7 +463,7 @@ $form["tabs"]['web'] = array ( 'width' => '40', 'maxlength' => '255' ), - 'awstats_updateall_pl' => array ( + 'awstats_buildstaticpages_pl' => array ( 'datatype' => 'VARCHAR', 'formtype' => 'TEXT', 'default' => '', diff --git a/interface/web/admin/lib/lang/en_server_config.lng b/interface/web/admin/lib/lang/en_server_config.lng index 0a122e3caa96e20b0caa991f93a53dc4027f78b8..761150a29e8f238e418bcd0fcbf40252e749e342 100644 --- a/interface/web/admin/lib/lang/en_server_config.lng +++ b/interface/web/admin/lib/lang/en_server_config.lng @@ -68,5 +68,5 @@ $wb["htaccess_allow_override_error_empty"] = '.htaccess AllowOverride is empty.' $wb["awstats_conf_dir_txt"] = 'awstats conf folder'; $wb["awstats_data_dir_txt"] = 'awstats data folder'; $wb["awstats_pl_txt"] = 'awstats.pl script'; -$wb["awstats_updateall_pl_txt"] = 'awstats_updateall script'; +$wb["awstats_buildstaticpages_pl_txt"] = 'awstats_buildstaticpages.pl script'; ?> \ No newline at end of file diff --git a/interface/web/admin/templates/server_config_web_edit.htm b/interface/web/admin/templates/server_config_web_edit.htm index 83d3bbb2a401bc3fe533fac0ddb4f6800314d5c4..d08d032c46880f50934dd17fb8d687c9cf953663 100644 --- a/interface/web/admin/templates/server_config_web_edit.htm +++ b/interface/web/admin/templates/server_config_web_edit.htm @@ -74,8 +74,8 @@
- - + +
diff --git a/server/cron_daily.php b/server/cron_daily.php index 5b731bad876b77ae04340e2bb9830ba72319379c..b861558f7190a2b1c2876ee657674861c5d84d69 100644 --- a/server/cron_daily.php +++ b/server/cron_daily.php @@ -168,19 +168,20 @@ foreach($records as $rec) { $domain = escapeshellcmd($rec["domain"]); $statsdir = escapeshellcmd($rec["document_root"].'/web/stats'); $awstats_pl = $web_config['awstats_pl']; - $awstats_updateall_pl = $web_config['awstats_updateall_pl']; + $awstats_buildstaticpages_pl = $web_config['awstats_buildstaticpages_pl']; if(!@is_dir($statsdir)) mkdir($statsdir); // awstats_buildstaticpages.pl -update -config=mydomain.com -lang=en -dir=/var/www/domain.com/web/stats -awstatsprog=/path/to/awstats.pl - $command = "$awstats_updateall_pl -update -config='$domain' -lang=en -dir='$statsdir' -awstatsprog='$awstats_pl'"; + $command = "$awstats_buildstaticpages_pl -update -config='$domain' -lang=en -dir='$statsdir' -awstatsprog='$awstats_pl'"; - if($awstats_pl != '' && $awstats_updateall_pl != '' && fileowner($awstats_pl) == 0 && fileowner($awstats_updateall_pl) == 0) { + if($awstats_pl != '' && $awstats_buildstaticpages_pl != '' && fileowner($awstats_pl) == 0 && fileowner($awstats_buildstaticpages_pl) == 0) { exec($command); + rename($rec["document_root"].'/web/stats/awstats.'.$domain.'.html',$rec["document_root"].'/web/stats/index.html'); $app->log("Created awstats statistics with command: $command",LOGLEVEL_DEBUG); } else { - $app->log("No awstats statistics created. Either $awstats_pl or $awstats_updateall_pl is not owned by root user.",LOGLEVEL_WARN); + $app->log("No awstats statistics created. Either $awstats_pl or $awstats_buildstaticpages_pl is not owned by root user.",LOGLEVEL_WARN); } } diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index 0a770380d777f618f2cc3be9262105d014ac6b8d..c0fd8223e90878861ac8cde78b09b93a6299ae5b 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -1211,16 +1211,18 @@ class apache2_plugin { private function awstats_update ($data,$web_config) { global $app; + $awstats_conf_dir = $web_config['awstats_conf_dir']; + if(!@is_file($awstats_conf_dir."/awstats.".$data["new"]["domain"].".conf") || ($data["old"]["domain"] != '' && $data["new"]["domain"] != $data["old"]["domain"])) { if ( @is_file($awstats_conf_dir."/awstats.".$data["old"]["domain"].".conf") ) { unlink($awstats_conf_dir."/awstats.".$data["old"]["domain"].".conf"); } $content = ''; - $content .= "Include '".$awstats_conf_dir."/awstats.conf'\n"; - $content .= "LogFile='/var/log/ispconfig/httpd/".$data["new"]["domain"]."/access.log'\n"; - $content .= "SiteDomain='".$data["new"]["domain"]."'\n"; - $content .= "HostAliases='www.".$data["new"]["domain"]." localhost 127.0.0.1'\n"; + $content .= "Include \"".$awstats_conf_dir."/awstats.conf\"\n"; + $content .= "LogFile=\"/var/log/ispconfig/httpd/".$data["new"]["domain"]."/access.log\"\n"; + $content .= "SiteDomain=\"".$data["new"]["domain"]."\"\n"; + $content .= "HostAliases=\"www.".$data["new"]["domain"]." localhost 127.0.0.1\"\n"; file_put_contents($awstats_conf_dir.'/awstats.'.$data["new"]["domain"].'.conf',$content); $app->log("Created awstats config file: ".$awstats_conf_dir.'/awstats.'.$data["new"]["domain"].'.conf',LOGLEVEL_DEBUG);