免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1794 | 回复: 0
打印 上一主题 下一主题

流量统计awstats-6.7-1.noarch.rpm的安装及配置(整理) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-10-31 00:06 |只看该作者 |倒序浏览
流量统计awstats-6.7-1.noarch.rpm的安装及配置(整理)
1. #rpm -ivh awstats-6.7-1.noarch.rpm
2. #cd /usr/local/awstats/tools/
#./awstats_configure.pl  //以下是此处设置过程
—– AWStats awstats_configure 1.0 (build 1.7) (c) Laurent Destailleur —–
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to ‘understand’ all possible ways to use AWStats…
Read the AWStats documentation (docs/index.html).
—–> Running OS detected: Linux, BSD or Unix
—–> Check for web server install
Enter full config file path of your Web server.
Example: /etc/httpd/httpd.conf
Example: /usr/local/apache2/conf/httpd.conf
Example: c:\Program files\apache group\apache\conf\httpd.conf
Config file path (’none’ to skip web server setup):
> none                       //输入 none
Your web server config file(s) could not be found.
You will need to setup your web server manually to declare AWStats
script as a CGI, if you want to build reports dynamically.
See AWStats setup documentation (file docs/index.html)
—–> Update model config file ‘/etc/awstats/awstats.model.conf’
File awstats.model.conf updated.
—–> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ? y                //输入 y
—–> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
> www.mysite.com             //输入你想做流量监控的网站域名 此处为www.mysite.com
—–> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
>                               //回车默认
—–> Create config file ‘/etc/awstats/awstats.www.mysite.com.conf’
Config file /etc/awstats/awstats.www.mysite.com.conf created.
—–> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.mysite.com
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue…                 //回车继续
A SIMPLE config file has been created:
/etc/awstats/awstats.www.mysite.com.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for ‘www.mysite.com’ with command:
> perl awstats.pl -update -config=www.mysite.com
You can also build static report pages for ‘www.mysite.com’ with command:
> perl awstats.pl -output=pagetype -config=www.mysite.com
Press ENTER to finish…             //回车设置完成.
3.以上步驟完成后,会在/etc/awstats目录下建立一文件:
awstats.www.mysite.com.conf
4. 建立/var/lib/awstats 目录,並給予 777 之权限
注:若不給予777权限,将来若设定
AllowToUpdateStatsFromBrowser=1  时,会无法透过Browser来及时更新Report.
5.设定 httpd.conf,检查在httpd.conf中是否有以下设定,如果沒有的话,请自行加入,并且重新启动httpd服务.
代码:
#
# Directives to add to your Apache conf file to allow use of AWStats as a CGI.
# Note that path “/usr/local/awstats/” must reflect your AWStats install path.
#
Alias /awstatsclasses “/usr/local/awstats/wwwroot/classes/”
Alias /awstatscss “/usr/local/awstats/wwwroot/css/”
Alias /awstatsicons “/usr/local/awstats/wwwroot/icon/”
ScriptAlias /awstats/ “/usr/local/awstats/wwwroot/cgi-bin/”
#
# This is to permit URL access to scripts/files in AWStats directory.
#
Options None
AllowOverride None
Order allow,deny
Allow from all
6.   1>设定httpd的log format为combined,编辑httpd.conf,将CustomLog设定为combined
注;如果你有多个Virtual Domain的話,建议分成不同的access log,以利分析
例如:
CustomLog logs/www.mysite.com_access_log combined
2>设定生成的配置文件:
#vi /etc/awstats/awstats.www.mysite.com.conf
LogFile=”/var/log/httpd/www.mysite.com_access_log”  <—-请指定为要分析的Apache日志路径与文件名
LogType=W <—- W代表分析类型为web log files
LogFormat=1 <—- 1代表Apache or Lotus Notes/Domino native combined log format
SiteDomain=”www.mysite.com” <–指定从log文档中过滤符合SiteDomain的记录(不同的Virtual Domain就须指定为不同的SiteDomain)
HostAliases=”mysite.com www.mysite.com” <–指定哪些Domain为Local,其余皆视为External.
7.执行awstats.pl
# /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=www.mysite.com -update
如果出现以下信息,就代表执行成功
Update for config “/etc/awstats/awstats.www.myunix.idv.tw.conf”
With data in log file “/var/log/httpd/access_log.1″…
Phase 1 : First bypass old records, searching new record…
Direct access after last parsed record (after line 4311)
Jumped lines in file: 4311
Found 4311 already parsed records.
Parsed lines in file: 0
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 0 new qualified records.
8. 开启Browser,输入
http://www.mysite.com/awstats/awstats.pl?config=www.mysite.com
便可检视你刚刚产生的报表了.
9.记得将步骤7的命令设定在crontab,让它定期产生Log Report.
                               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/2042/showart_411108.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP