Debian下配置AWStats

1、安装awstats。直接使用apt-get install awstats
2、检察awstats 是否正常。awstias在在ubuntu上有/etc/awstats和/usr/share/awstats 目录。
而根据网上教程,需要找到他的pl文件来完成配置。
使用find / -name awstats.pl 来进行查找,结果为/usr/lib/cgi-bin/awstats.pl.
还是没有找到配置文件。只好find / -name *.pl|more
结果,n多的文件。。。。不过显示了/usr/share/doc/awstats/examples/
3、运行./awstats_configure.pl
会有提示。第一步,指定apache2配置文件的准确位置。
第二步,生成配置文件。第一次安装时必须。会提示你输入web的域名
第三步,选择配置文件的存放目录。默认是/etc/awstats
结果:Error: Failed to open ‘/usr/share/doc/awstats/examples/wwwroot/cgi-
 
bin/awstats.model.conf’ for read.
仔细看执行过程,有Warning: AWStats standard directory on Linux OS is ‘/usr/local/awstats’.
If you want to use standard directory, you should first move all content
of AWStats distribution from current directory:
/usr/share/doc/awstats/examples
to standard directory:
/usr/local/awstats
查看安装说明把。。README.Debian。
4、无奈,只好man awstats_configure.pl。结果发现
 
$AWSTATS_ICON_PATH=’/usr/local/awstats/wwwroot/icon’;
$AWSTATS_CSS_PATH=’/usr/local/awstats/wwwroot/css’;
$AWSTATS_CLASSES_PATH=’/usr/local/awstats/wwwroot/classes’;
$AWSTATS_CGI_PATH=’/usr/local/awstats/wwwroot/cgi-bin’;
$AWSTATS_MODEL_CONFIG=’/etc/awstats/awstats.model.conf’;                # Used only when
 
configure ran on linux
$AWSTATS_DIRDATA_PATH=’/var/lib/awstats’
 
所以,可能问题在这个地方。不管了。备份一下。然后修改
icon的路径/usr/share/awstats/icon
css文件的路径/usr/share/doc/awstats/examples/css
没有找到/usr/local/awstats/wwwroot/classes对应目录。
cgi目录也没有相应的。只好定位到/usr/lib/cgi-bin
awstats.model.conf没有找到。但发现example目录下有一个awstats.model.conf.gz。解压缩,发现
awstats.model.conf就在这里;)于是仅仅修改
 
$AWSTATS_MODEL_CONFIG=’/usr/share/doc/awstats/examples/awstats.model.conf’;结果运行,不成功
 
。。
5、将awstats.model.conf复制到/etc/awstats中。然后重新运行。提示
—–> Create config file ‘/etc/awstats/awstats.computer.ouc.edu.cn.conf’
 Config file /etc/awstats/awstats.computer.ouc.edu.cn.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/share/doc/awstats/examples/wwwroot/cgi-bin/awstats.pl -update –
 
config=computer.ouc.edu.cn
Or if you have several config files and prefer having only one command:
/usr/share/doc/awstats/examples/tools/awstats_updateall.pl now
看来生成正常。但以前我执行过,所以。。
6、按照提示继续把。执行./awstats.pl -update -config=computer.ouc.edu.cn
提示With data in log file "/var/log/httpd/mylog.log"…
Error: Couldn’t open server log file "/var/log/httpd/mylog.log" : 没有那个文件或目录
应该是日子的问题。嘿嘿。修改/etc/awstats下的配置文件。把路径指向apache2的日子位置
7、重新执行。终于正常了
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: 2581
 Found 0 dropped records,
 Found 4 corrupted records,
 Found 0 old records,
 Found 2577 new qualified records.
8、现在就是设置awstats的web问题了。
用web访问awstats.pl。正常显示。嘿嘿。不过似乎图片等不正常。看看路径
http://computer.ouc.edu.cn/awstatsicons/browser/msie.png。然后使用无敌find大法。
find / -name msie.png。结果/usr/share/awstats/icon/browser/msie.png
嘿嘿。把usr/share/awstats/icon所有文件复制到web目录相应位置就行了。正常。嘿嘿
 

Leave a Reply

Your email address will not be published. Required fields are marked *