默認安裝好的awstats統計工具在顯示中文時會出現亂碼,經過如下幾個步驟解決:web
一、打開所要統計網站的配置文件awstats.xxxxx.conf,通常在/etc/awstats下,去掉shell
#LoadPlugin="decodeutfkeys"
前面的#,接下來訪問統計的頁面可能會出現以下的錯誤提示:ide
Error: Plugin load for plugin 'decodeutfkeys' failed with return code: Error: Can't locate URI/Escape.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl . /usr/share/awstats/lib /usr/share/awstats/plugins) at (eval 3) line 1. Setup ('/etc/awstats/awstats.bbsnuaa.conf' file, web server or permissions) may be wrong. Check config file, permissions and AWStats documentation (in 'docs' directory).
二、解決這個問題可採用Perl的CPAN,打開的命令工具
[root@server ~]# perl -MCPAN -e shell
三、安裝Perl URI/Escape模塊網站
install URI::Escape
安裝完成以後再運行code
/usr/lib/cgi-bin/awstats.pl -config=XXXXX -update