????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 7
nocompress
prerotate
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=yoursite.com
endscript
postrotate
if [ -f /usr/local/nginx/logs/nginx.pid ]; then
kill -USR1 `cat /usr/local/nginx/logs/nginx.pid`
fi
endscript
}
??????? rotate ??????????? awstats ???????????? rotate ????? nginx ?????????д???μ?????????
????logrotate ?????/etc/logrotate.conf?????????/etc/logrotate.d?????е???????????????????? logrotate ??????????/etc/logrotate.d????????????????????
????д???????????С??????? debug ???鷳 ?? ???????????????е?nocompress???????????????/etc/logrotate.conf?е? compress?? ??????????????????/etc/logrotate.d?е???????????? logrotate ??????/etc/logrotate.conf????????? /var/log/messages ????????? mail ?к??????????????????????????????????? /var/log/messages ????????? mail ?????????