Ok, I have a couple of suggestions/theories:
1) Because you had to install
Webalizer after you did the Sentora installation, there is a line in the installation script that will have been missed and will probably need to be run (to delete the default conf file). Depending on your OS it is one of these:
CentOS:
Code:
rm -rf /etc/webalizer.conf
or Debian/Ubuntu:
Code:
rm -rf /etc/webalizer/webalizer.conf
2) For some reason, the code that runs
Webalizer has command line options in a certain order which no longer seem to pass the virtual host's domain to
Webalizer correctly, so I have rewritten it on my servers and it now should pass the correct website name and URLs for the generation of
Webalizer stats for each website you host. I'm on CentOS 7 so this should work for you (Debian/Ubuntu users might need to adjust the edit path etc.):
Code:
vi /etc/sentora/panel/modules/webalizer_stats/hooks/OnDaemonHour.hook.php
Replace the contents of this file with this code:
Code:
<?php
/**
* @copyright 2014-2015 Sentora Project (http://www.sentora.org/)
* Sentora is a GPL fork of the ZPanel Project whose original header follows:
*
* ZPanel - Visitor Stats zpanel plugin, written by RusTus: www.zpanelcp.com.
*
* changes P;Peyremorte : reduced duplicate strings constructions
*/
echo fs_filehandler::NewLine() . "BEGIN Webalizer Stats" . fs_filehandler::NewLine();
if ( ui_module::CheckModuleEnabled( 'Webalizer Stats' ) ) {
GenerateWebalizerStats();
}
else {
echo "Webalizer Stats Module DISABLED." . fs_filehandler::NewLine();
}
echo "END Webalizer Stats" . fs_filehandler::NewLine();
function GenerateWebalizerStats()
{
global $zdbh;
$sql = $zdbh->prepare( "SELECT * FROM x_vhosts LEFT JOIN x_accounts ON x_vhosts.vh_acc_fk=x_accounts.ac_id_pk WHERE vh_deleted_ts IS NULL" );
$sql->execute();
echo "Generating webalizer stats html..." . fs_filehandler::NewLine();
while ( $rowvhost = $sql->fetch() ) {
$basedir = ctrl_options::GetSystemOption( 'sentora_root' ) . "modules/webalizer_stats/stats/" . $rowvhost[ 'ac_user_vc' ] . "/" . $rowvhost[ 'vh_name_vc' ];
if ( !file_exists( $basedir ) ) {
@mkdir( $basedir, 0755, TRUE );
}
/** set webalizer command dependant on OS */
if ( sys_versions::ShowOSPlatformVersion() == "Windows" ) {
$command = ctrl_options::GetSystemOption( 'sentora_root' ) .
'modules/webalizer_stats/bin/webalizer.exe';
}
else {
chmod( ctrl_options::GetSystemOption( 'sentora_root' ) . "modules/webalizer_stats/bin/webalizer", 4777 );
$command = "webalizer";
}
/** all other args and flags are the same so keep them outsite to avoid duplication */
$flag = '-o';
$secondFlags = '-d -F clf';
$domain = '-n' . $rowvhost[ 'vh_name_vc' ];
$logFile = realpath( ctrl_options::GetSystemOption( 'log_dir' ) .
'domains/' .
$rowvhost[ 'ac_user_vc' ] .
'/' .
$rowvhost[ 'vh_name_vc' ] .
'-access.log' );
$statsPath = ctrl_options::GetSystemOption( 'sentora_root' ) .
"modules/webalizer_stats/stats/" .
$rowvhost[ 'ac_user_vc' ] .
'/' .
$rowvhost[ 'vh_name_vc' ];
/** build arg array, this is in the required order! do not just change the order of this array */
$args = array(
$logFile,
$domain,
$flag,
$statsPath,
$secondFlags,
);
echo "Generating stats for: " . $rowvhost[ 'ac_user_vc' ] . "/" . $rowvhost[ 'vh_name_vc' ] . fs_filehandler::NewLine();
$returnValue = ctrl_system::systemCommand( $command, $args );
echo (0 === $returnValue ? 'Succeeded' : 'Failed') . fs_filehandler::NewLine();
}
}
?>
and save the new file.
Give the daemon a chance to run and see if this makes a difference to your
Webalizer stats. If not let me know!
Keith