1)创建日志目录
nginx的默认日志目录所在硬盘空间可能比较小,所以根据硬盘的空间状况创建日志目录
比如:mkdir /backup/nginx_logs
2)修改nginx配置文件
配置nginx的日志目录,指向你刚创建的目录
在配置文件中写:
根据时间情况写在server或者http或者location 块,本例写在server块
access_log /backup/nginx_logs/access.log combined;
上面的combined为nginx的默认日志格式,如果不这么写就需要重新定义,
本例中直接写了combined,这种格式awstats也认
3)使用logrotate管理
logrotate系统自带,并且会自动定时在凌晨4:02份启动
配置文件如下:/backup/nginx_logs { daily missingok rotate 7nocom阅读全文>
发表于 @ 2008年10月13日 15:51:00|评论(loading...)|编辑|收藏
1)cd /usr/local/src
2)wget http://prdownloads.sourceforge.net/awstats/awstats-6.8.tar.gz
3)tar xzvf awstats-6.8.tar.gz
4)cp -r awstats-6.8 /usr/local/awstats
5)cd /usr/local/awstats/
6)perl /usr/local/awstats/tools/awstats_configure.pl
结果如下:
-----> Check for web server installEnter full config file path of your Web server.Example: /etc/httpd/httpd.confExample: /usr/local/apache2/conf/httpd.confExample: c:\Program files\apache group\apach阅读全文>
发表于 @ 2008年10月13日 15:15:00|评论(loading...)|编辑|收藏