11 月 302012
 

解压缩后移动并重命名
[root@monitor ~]# mv awstats-7.0 /usr/local/awstats

查看程序目录结构
[root@monitor ~]# cd /usr/local/awstats/
[root@monitor awstats]# ls
docs README.TXT tools wwwroot

查看脚本配置工具
[root@monitor awstats]# cd tools/
[root@monitor tools]# ls
awstats_buildstaticpages.pl awstats_exportlib.pl geoip_generator.pl logresolvemerge.pl

urlaliasbuilder.pl xslt
awstats_configure.pl awstats_updateall.pl httpd_conf maillogconvert.pl webmin

创建统计数据存储目录 (AWStats database)
#mkdir /usr/local/awstats/lib
配置文件DirData参数指定,默认/var/lib/awstats

#mkdir /usr/local/awstats/etc
定义配置文件路径时指定,默认/etc/awstats

#mkdir /usr/local/awstats/logs
配置文件LogFile参数指定

执行安装配置脚本

[root@monitor tools]# perl awstats_configure.pl

—– AWStats awstats_configure 1.0 (build 1.9) (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

首次安装需指定Apache配置文件路径,再次配置时选择none选项跳过
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):
> /etc/httpd/conf/httpd.conf

—–> Check and complete web server config file ‘/etc/httpd/conf/httpd.conf’
Add ‘Alias /awstatsclasses “/usr/local/awstats/wwwroot/classes/”‘
Add ‘Alias /awstatscss “/usr/local/awstats/wwwroot/css/”‘
Add ‘Alias /awstatsicons “/usr/local/awstats/wwwroot/icon/”‘
Add ‘ScriptAlias /awstats/ “/usr/local/awstats/wwwroot/cgi-bin/”‘
Add ‘<Directory>’ directive
AWStats directives added to Apache config file.

—–> Update model config file ‘/usr/local/awstats/wwwroot/cgi-bin/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

定义配置文件名称
—–> 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:
> gup.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.gup.com.conf’
Config file /etc/awstats/awstats.gup.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=gup.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.gup.com.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for ‘gup.com’ with command:
> perl awstats.pl -update -config=gup.com
You can also build static report pages for ‘gup.com’ with command:
> perl awstats.pl -output=pagetype -config=gup.com

Press ENTER to finish…

[root@monitor tools]#

编辑配置文件
日志合并分析

加入计划任务
更新指定配置文件
#/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=gup.com
更新所有配置文件
#/usr/local/awstats/tools/awstats_updateall.pl now

生成静态页面
#awstats.pl -output=gup.html -config=gup.com > index.html

目录设置问题
[root@monitor logs]# perl ../wwwroot/cgi-bin/awstats.pl -update -config=gup.com
Error: AWStats database directory defined in config file by ‘DirData’ parameter

(/usr/local/awstats/lib) does not exist or is not writable.
Setup (‘/etc/awstats/awstats.gup.com.conf’ file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in ‘docs’ directory).

手工生成统计
[root@monitor logs]# perl ../wwwroot/cgi-bin/awstats.pl -update -config=gup.com
Create/Update database for config “/etc/awstats/awstats.gup.com.conf” by AWStats version 7.0 (build

1.971)
From data in log file “/usr/local/awstats/logs/app01_access_log.2012-11.txt”…
Phase 1 : First bypass old records, searching new record…
Searching new records from beginning of log file…
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)…
Jumped lines in file: 0
Parsed lines in file: 4
Found 0 dropped records,
Found 0 comments,
Found 0 blank records,
Found 0 corrupted records,
Found 0 old records,
Found 4 new qualified records.

实际地址
http://192.168.11.70/awstats/awstats.pl?config=gup.com

相关下载:
(1)AWStats 7.0

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据