| | |
| | | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| | | */ |
| | | |
| | | require('lib/config.inc.php'); |
| | | require('lib/app.inc.php'); |
| | | define('SCRIPT_PATH', dirname($_SERVER["SCRIPT_FILENAME"])); |
| | | require(SCRIPT_PATH."/lib/config.inc.php"); |
| | | require(SCRIPT_PATH."/lib/app.inc.php"); |
| | | |
| | | set_time_limit(0); |
| | | |
| | |
| | | |
| | | if(is_file($awstats_website_conf_file)) unlink($awstats_website_conf_file); |
| | | |
| | | $sql = "SELECT domain FROM web_domain WHERE (type = 'alias' OR AND type = 'subdomain') server_id = ".$conf['server_id']; |
| | | $aliases = $app->db->queryAllRecords($sql); |
| | | $aliasdomain = ''; |
| | | |
| | | if(is_array($aliases)) { |
| | | foreach ($aliases as $alias) { |
| | | $aliasdomain.= ' '.$alias['domain']. ' www.'.$alias['domain']; |
| | | } |
| | | } |
| | | |
| | | if(!is_file($awstats_website_conf_file)) { |
| | | $awstats_conf_file_content = 'Include "'.$awstats_conf_dir.'/awstats.conf" |
| | | LogFile="/var/log/ispconfig/httpd/'.$domain.'/yesterday-access.log" |
| | | SiteDomain="'.$domain.'" |
| | | HostAliases="www.'.$domain.' localhost 127.0.0.1"'; |
| | | HostAliases="www.'.$domain.' localhost 127.0.0.1"'.$aliasdomain; |
| | | file_put_contents($awstats_website_conf_file,$awstats_conf_file_content); |
| | | } |
| | | |
| | |
| | | symlink($logfile,'/var/log/ispconfig/httpd/'.$domain.'/yesterday-access.log'); |
| | | |
| | | // awstats_buildstaticpages.pl -update -config=mydomain.com -lang=en -dir=/var/www/domain.com/web/stats -awstatsprog=/path/to/awstats.pl |
| | | $command = "$awstats_buildstaticpages_pl -update -config='$domain' -lang=en -dir='$statsdir' -awstatsprog='$awstats_pl'"; |
| | | $command = "$awstats_buildstaticpages_pl -update -config='$domain' -lang=".$conf['language']." -dir='$statsdir' -awstatsprog='$awstats_pl'"; |
| | | |
| | | if($awstats_pl != '' && $awstats_buildstaticpages_pl != '' && fileowner($awstats_pl) == 0 && fileowner($awstats_buildstaticpages_pl) == 0) { |
| | | exec($command); |