本站首页    管理页面    写新日志    退出


«August 2025»
12
3456789
10111213141516
17181920212223
24252627282930
31


公告
 本博客在此声明所有文章均为转摘,只做资料收集使用。

我的分类(专题)

日志更新

最新评论

留言板

链接

Blog信息
blog名称:
日志总数:1304
评论数量:2242
留言数量:5
访问次数:7591543
建立时间:2006年5月29日




[Ubuntu]Configuring Awstats with Apache 2 on Ubuntu
软件技术

lhwork 发表于 2007/2/9 21:41:24

Being able to track your web statistics is important for commercial sites. For personal sites it may not be as important, but it still nice to know where people are coming from and what they are looking for. There are a number of open source log analysers that work with Apache, however my preferred choice is Awstats. It may not be able to give the same level of detail as a commercial package such as Urchin, but it provides more than enough detail for most purposes. On Ubuntu you can install awstats via apt: apt-get install awstats This will install the base package however, if you want to lever its full power you will need to install a couple of extra Perl modules. apt-get install libnet-ip-perl If you would like to see which countries your visitors are based in then you should look at one of the IP to Country plugins which will give you a Geo IP lookup. You can choose between either geoipfree or GeoIp. Other useful plugins are: Plugin: HostInfo - which gives you a popup whois windowPlugin: IPv6 - adds IPv6 supportPlugin: Tooltips - confused by all the information? This will take away the mystery 500)this.width=500'> On rpm-based system there is a handy little perl script that walks you through the initial configuration. On Ubuntu you have to do it by hand, however most of the configuration is self-explanatory. Simply copy the provided sample config to a new config file: cp awstats.conf awstats.yoursite.tld.conf NB: You will need a separate configuration file for each vhost you wish to examine. Edit the conf file to match your site’s setup. Important things to pay attention to are any domain aliases, the location of the log files and any IPs you wish to ignore (eg. your own) You can also decide which optional plugins you want to load. Simply add a line to invoke each one: LoadPlugin="geoipfree" LoadPlugin="ipv6" LoadPlugin="Tooltips" geoipfree requires an extra perl module. On ubuntu the package is called libgeo-ipfree-perl You are almost ready! You now need to configure Apache to allow access to your awstats pages. Rather than messing about with my main Apache config file I found it neater to place the awstats specific information in an external file called awstats.conf: Options None AllowOverride None Order allow,deny Allow from all Alias /awstatsicons/ /usr/share/awstats/icon/ ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ AllowOverride None Options ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all Then use an include directive in your main Apache config (apache2.conf): Include /etc/apache2/awstats.conf You then need to add it in to your vhost: ScriptAlias /whereyouwanttoaccessit/ /usr/lib/cgi-bin/ If you navigate to: http://www.yourdomain.tld/whereyouwanttoaccessit/awstats.pl?config=yourdomain.tld You *should* be able to access your stats. Of course you’ll need to actually generate the stats first: /usr/lib/cgi-bin/awstats.pl -config=yourdomain.tld -update I would recommend you run this from the command line once to create the first set of stats and then add a cronjob: crontab -e 0,10,20,30,40,50 * * * * /usr/lib/cgi-bin/awstats.pl -config=yourdomain.tld -update >/dev/null wq This will update your stats every 10 minutes, which means that you’ll only have to update a few lines at a time. If your site is busy this makes sense 500)this.width=500'> The last part of the line is important: >/dev/null By default cron emails the user each time it runs. You really don’t want 6 emails an hour telling you that Awstats has run 500)this.width=500'> NB: This works for me. Your mileage may vary. If I’ve left out anything blatantly obvious please let me know


阅读全文(4177) | 回复(0) | 编辑 | 精华
 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.359 second(s), page refreshed 144775974 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号