broken web statistics - empty log dir
In my installation web statistics were not working. The directory /var/www/clients/[clientX]/[domain]/log was never populated with log files, vlogger used the directory schema /var/log/ispconfig/httpd/[domain]. I could not see any obvious ways (configuration options) to change this, so I patched cron_daily.php as the following:
----------- diff begin
*** cron_daily.php.orig 2015-04-09 03:29:54.565646704 -0500 --- cron_daily.php 2015-04-09 03:27:19.173639516 -0500 *************** function setConfigVar( $filename, $varNa *** 276,281 **** --- 276,305 ----
- // PATCH begin
-
sql = "SELECT domain_id, domain, type, document_root, web_folder, parent_domain_id FROM web_domain WHERE (type = 'vhost' or type = 'vhostsubdomain') AND server_id = ".
conf['server_id']; - $records = $app->db->queryAllRecords($sql);
- foreach($records as $rec) {
- //* create traffic statistics based on yesterdays access log file
- $yesterday = date('Ymd', time() - 86400);
- $logfile = $rec['document_root'].'/' .
log_folder . '/'.
yesterday.'-access.log'; - $total_bytes = 0;
- // at first lets move the log files into client directory
-
genlog = "/var/log/ispconfig/httpd/{
rec['domain']}/$yesterday-access.log"; - echo "generic logfile: $genlog\n";
- if((is_file(
genlog))and(!file_exists(
logfile))) { -
echo "renaming $genlog to $logfile\n";
-
rename($genlog, $logfile);
- }
- }
- // PATCH end
-
sql = "SELECT domain_id, domain, document_root, web_folder, type, parent_domain_id FROM web_domain WHERE (type = 'vhost' or type = 'vhostsubdomain') and stats_type = 'webalizer' AND server_id = ".
conf['server_id']; $records = $app->db->queryAllRecords($sql);
----------- diff end
If there is a better way for fixing this, please let me know.