不一样的思想~~ http://shop34712791.taobao.com MSN:wins0910@hotmail.com

logrotate

上一篇 / 下一篇  2008-02-26 23:22:57 / 个人分类:待分析

/usr/local/apache-server1/logs/* {
   weekly
   size=100M
   rotate 4
   compress

   postrotate
   /bin/kill -1 `cat /usr/local/apache/PID/httpd.pid`
   endscrīpt
}

向进程发送HUP信号,使其重新读取配置文件。
因为apache是持续性运行,日志文件始终处于打开状态,执行日志轮转后,日志不会被保存到新的access_log中。而/var/log/wtmp只是在是在用户登陆系统时被打开,存入日志后文件后被关闭。
 
----
sort -m -t " " -k 4 -o logall log1 log2
 
----
 
安装了awstats来分析日志 用命令
/usr/local/awstats/wwwroot/cgi-bin/perl awstats.pl -config=www.abc.com -update -lang=cn
分析日志没有问题
此时日志格式如下
LogFile="/usr/local/apache/logs/access_log"
设置
AllowToUpdateStatsFromBrowser=1
在页面可以点更新 且正常分析日志

但是当日志格式设置为
LogFile="gzip -d </usr/local/apache/logs/access_log.gz |"
时 用命令分析日志没有问题 但是启用从浏览器中实时更新统计即AllowToUpdateStatsFromBrowser=1时
点击更新出现Error: Command for pipe 'gzip -d </usr/local/apache/logs/access_log.gz |' failed
Setup ('/etc/awstats/awstats.www.abc.com.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

虽然说做到crontab中可以更新。但总感觉不爽,也搜了些资料说是权限问题 但还是无法解决 特
请教!看下面帮助说是权限问题
可我的如下,还是有问题
/usr/local/awstats/data
drwxr-xr-x 2 daemon daemon 4096 01-15 05:21 data
data内文件也都属主daemon 权限为755了
# When AWStats updates its statistics, it stores results of its analysis in
# files (AWStats database). All those files are written in the directory
# defined by the "DirData" parameter. Set this value to the directory where
# you want AWStats to save its database and working files into.
# Warning: If you want to be able to use the "AllowToUpdateStatsFromBrowser"
# feature (see later), you need "Write" permissions by web server user on this
# directory (and "Modify" for Windows NTFS file systems).
# Example: "/var/lib/awstats"
# Example: "../data"
# Example: "C:/awstats_data_dir"
# Default: "."          (means same directory as awstats.pl)
#
DirData="/usr/local/awstats/data"

# When this parameter is set to 1, AWStats add a button on report page to
# allow to "update" statistics from a web browser. Warning, when "update" is
# made from a browser, AWStats is ran as a CGI by the web server user defined
# in your web server (user "nobody" by default with Apache, "IUSR_XXX" with
# IIS), so the "DirData" directory and all already existing history files
# awstatsMMYYYY[.xxx].txt must be writable by this user. Change permissions if
# necessary to "Read/Write" (and "Modify" for Windows NTFS file systems).
# Warning: Update process can be long so you might experience "time out"
# browser errors if you don't launch AWStats enough frequently.
# When set to 0, update is only made when AWStats is ran from the command
# line interface (or a task scheduler).
# Possible values: 0 or 1
# Default: 0
#
AllowToUpdateStatsFromBrowser=1
 

相关阅读:

TAG: 待分析

 

评分:0

我来说两句

Open Toolbar