LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1646|回复: 4

rotatelogs总是提示错误:找不到日志文件

[复制链接]
发表于 2007-3-30 16:50:26 | 显示全部楼层 |阅读模式
linux: fedora core 5
apache: 2.2
php: 5

得知apache自带回滚程序后,在httpd.conf文件中添加了
    CustomLog "|/usr/sbin/rotatelogs /var/log/httpd/access_log.%Y%m%d 86400" common

但是从那以后,apache就在也不写access_log日志了,查看error_log得知:
    1 Previous file handle doesn't exists /var/log/httpd/access_log.20070330
    piped log program '/usr/sbin/rotatelogs /var/log/httpd/access_log.%Y%m%d 86400' failed unexpectedly

于是:
    #touch /var/log/httpd/access_log.20070330
重启apache
在firefox中访问localehost成功,于是再次查看日志:
    -rwxrwxrwx 1 root root      0 03-30 14:51 access_log.20070330
注:为了确定不是权限的问题,我把日志的权限都改成了777
然后是access_log.20070330的上一级目录的权限也设成了777
    drwxrwxrwx 3 root    root      4096 03-30 14:53 httpd

可是最后还是无法写入日志,error_log中的还是显示
    1 Previous file handle doesn't exists /var/log/httpd/access_log.20070330
    piped log program '/usr/sbin/rotatelogs /var/log/httpd/access_log.%Y%m%d 86400' failed unexpectedly
我都无奈了。。。

有没有人知道我到底错在哪了??
发表于 2007-3-31 12:33:58 | 显示全部楼层
试一下combined
还有,能贴一下你的logformat吗
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-4-18 16:32:37 | 显示全部楼层
202.118.17.166 - - [26/Mar/2007:20:58:17 +0800] "OST /neu/logging.php?action=login HTTP/1. 1" 200 3655 "http://219.216.66.115/neu/logging.php" "Mozilla/5.0 (X11; U; Linux i686; en-US ; rv:1.6) Gecko/20040510"
202.118.17.166 - - [26/Mar/2007:20:58:30 +0800] "GET /neu/admin.php HTTP/1.1" 200 3674 "-"  "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510"
202.118.17.166 - - [26/Mar/2007:20:58:30 +0800] "GET /neu/template/css/admin.css HTTP/1.1"  404 303 "http://219.216.66.115/neu/admin.php" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1 .6) Gecko/20040510"
192.168.0.12 - - [26/Mar/2007:22:50:53 +0800] "GET /web/__Works/%E4%BB%93%E5%BA%93%E8%B4%A7 %E4%BD%8D%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F/main.asp HTTP/1.1" 404 317 "-" "Mozilla/5.0 ( X11; U; Linux i686; zh-CN; rv:1.8.1.1) Gecko/20061208 Firefox/2.0.0.1"
202.118.17.184 - - [27/Mar/2007:19:00:13 +0800] "GET / HTTP/1.1" 200 1241 "-" "Mozilla/4.0  (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)"
202.118.17.184 - - [27/Mar/2007:19:00:14 +0800] "GET /image/logo.png HTTP/1.1" 200 253076 " http://219.216.66.115" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.432 2)"
202.118.17.184 - - [27/Mar/2007:20:13:32 +0800] "GET /xiaomao101 HTTP/1.1" 404 287 "-" "Moz illa/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)"
202.118.17.184 - - [27/Mar/2007:20:13:44 +0800] "GET / HTTP/1.1" 200 1241 "-" "Mozilla/4.0  (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)"
202.118.17.184 - - [27/Mar/2007:20:13:44 +0800] "GET /image/logo.png HTTP/1.1" 304 - "http: //219.216.66.115/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)"
202.118.17.184 - - [27/Mar/2007:20:13:49 +0800] "GET /xiaomao101 HTTP/1.1" 404 287 "-" "Moz illa/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)"
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-4-18 16:33:24 | 显示全部楼层
使用combined也是不行阿
回复 支持 反对

使用道具 举报

发表于 2008-1-19 16:14:54 | 显示全部楼层
哪位能人给点提示啊?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表