ubuntu apache 安装 awstats 流量分析工具

发布于 作者 量尺寸留下评论

如果网站没有开启CGI,则 a2enmod cgi 后重启apache

apt-get install awstats

vi /etc/awstats/awstats.conf

配置以下几项参数为相应值:

SiteDomain=”liangchicun.com”

HostAliases=”localhost 127.0.0.1 REGEX[server\.world$] REGEX[^10\.0\.0\.]”

DirIcons=”/icon”

在网站根目录下建立

mkdir /var/www/html/awstats

建立文件链接

ln -s /usr/share/awstats/icon /var/www/html/awstats/icon

编辑 /etc/apache2/sites-available 下的网站配置文件 000-default.conf ,加入

ScriptAlias /cgi-bin/awstats/ /usr/lib/cgi-bin/

<Directory “/var/www/html/cgi-bin”>
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
AddHandler cgi-script .cgi .py .pl
</Directory>

<Location /awstats>
Order Allow,deny
Allow from all
</Location>

重启apache服务

service apache2 restart

生成网站访问报告

/usr/lib/cgi-bin/awstats.pl -config=apache -update

现在可通过 http://网站域名/cgi-bin/awstats/awstats.pl 访问awstats了。

 

 

 

 

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注