hello, i have a 64 bit debian vps with ispconfig3, by default awstats language its georgian. how can i change this language ? in /etc/awstats/awstats.conf i've changed the Lang="auto" to Lang="en", then restart apache but doesnt change.
You must change language in ispconfig file: /usr/local/ispconfig/server/cron_daily.php Aprox line 200, search for this line: $command = "$awstats_buildstaticpages_pl -month='$awmonth' -year='$awyear' -update -config='$domain' -lang=es -dir='$statsdir' -awstatsprog='$awstat.............. replace -lang=en for the one you want. This night your stats will appear in your selected language.
Use this : http://www.howtoforge.com/forums/showthread.php?p=270816#post270816 Change the variable $LANG to the language that you want The variable is below ########################################### ############### RECREATE STATS ############### For permanent solution use post #4 in this thread (from erosbk)
I was wondering if I do this, it will chance all my stats to the language I enter in this line of code I think. I have some sites with different language set, so can this be done per site also? tia Appie
i managed to do this by adding the desired language to the site specific configuration file, e.g. by adding Lang="en" to /etc/awstats/awstats.english-site.com.conf and changing cron_daily.php to use this information instead of -lang=".$conf['language']." usually additions to a site specific awstats config file get lost, as cron_daily.php recreates those files every day. this patch changes this behavior and reads the language setting from the site specific config file and re-adds it when the new configuration file is created. additionally the -lang switch on the $awstats_buildstaticpages_pl command is removed so the awstats "Lang" setting is used: PHP: --- cron_daily.php.orig 2015-09-09 17:17:53.277736814 +0200+++ cron_daily.php 2015-09-09 17:17:15.213407807 +0200@@ -358,7 +358,15 @@ $awstats_conf_dir = $web_config['awstats_conf_dir']; $awstats_website_conf_file = $web_config['awstats_conf_dir'].'/awstats.'.$domain.'.conf';- if(is_file($awstats_website_conf_file)) unlink($awstats_website_conf_file);+ $existing_awstats_conf_array = array();+ if(is_file($awstats_website_conf_file)) {+ $existing_awstats_conf = file($awstats_website_conf_file);+ foreach ($existing_awstats_conf as $line) {+ if(preg_match("/Lang=/",$line)) $existing_awstats_conf_array['Lang'] = implode('',parse_ini_string($line));+ }++ unlink($awstats_website_conf_file);+ } $sql = "SELECT domain FROM web_domain WHERE (type = 'alias' OR type = 'subdomain') AND parent_domain_id = ".$rec['domain_id']; $aliases = $app->db->queryAllRecords($sql);@@ -375,6 +383,8 @@LogFile="/var/log/ispconfig/httpd/'.$domain.'/yesterday-access.log"SiteDomain="'.$domain.'"HostAliases="www.'.$domain.' localhost 127.0.0.1'.$aliasdomain.'"';+ if (array_key_exists('Lang',$existing_awstats_conf_array)) $awstats_conf_file_content .='+Lang="'.$existing_awstats_conf_array['Lang'].'"'; file_put_contents($awstats_website_conf_file, $awstats_conf_file_content); }@@ -396,7 +406,7 @@ // awstats_buildstaticpages.pl -update -config=mydomain.com -lang=en -dir=/var/www/domain.com/'.$web_folder.'/stats -awstatsprog=/path/to/awstats.pl // $command = "$awstats_buildstaticpages_pl -update -config='$domain' -lang=".$conf['language']." -dir='$statsdir' -awstatsprog='$awstats_pl'";- $command = "$awstats_buildstaticpages_pl -month='$awmonth' -year='$awyear' -update -config='$domain' -lang=".$conf['language']." -dir='$statsdir' -awstatsprog='$awstats_pl'";+ $command = "$awstats_buildstaticpages_pl -month='$awmonth' -year='$awyear' -update -config='$domain' -dir='$statsdir' -awstatsprog='$awstats_pl'"; if (date("d") == 2) { $awmonth = date("m")-1; I already added a Feature request on the German Forum: https://www.howtoforge.de/forum/thr...a-in-deutsch-und-webseite-b-in-englisch.9315/ feel free to "thumb up" the thread if you like the idea, comments on the patch are also very welcome!