AWstats 定期更新日志数据

(0 comments)

在Linux下,通过Cron可以很方便的定期更新日志数据:

01 01 * * * /var/www/liaojl.com/awstats/cgi-bin/awstats.pl \
-update -config=liaojl> /dev/null 2>&1

为了防止logrotate时丢失日志,在执行logrotate前,添加更新日志数据的命令,编辑/etc/logrotate.d/httpd文件,在postrotate前添加:

sharedscripts
prerotate
     /var/www/liaojl.com/awstats/cgi-bin/awstats.pl \
       -update -config=liaojl> /dev/null 2>&1 || true
endscript

另外,也可以通过浏览器更性AWStats日志数据,修改配置文件中的选项 AllowToUpdateStatsFromBrowser=1,在AWStats主页上就多出来update now的链接。不过这种方式需要apache用户有读取日志文件和写入datadir目录的权限,因此不是很安全并且很难控制。

Currently unrated

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required