apache 的日志问题

apache 的日志问题

一台服务器提供web服务,apache 2。0。52 做了好几个虚拟主机,每个虚拟主机的配置文件都差不多,但是其他几个网站的日志都按照logrotate的配置,是当前日志和保留的四周日志,只是有一个网站的访问日志没有rotate,是一个大文件,现在已经1GB多了,而且这个网站的error日志倒是对的,就是access日志有问题

问题可能出在哪里?谢谢!
http://man.chinaunix.net/newsoft ... nfig.html#customlog

還有 man rotatelogs

唉,你所了解的知识点,应该已经可以自己解决问题了,可是文档不是看报纸那种看法的啊,兄弟


QUOTE:
原帖由 alvis 于 2007-10-25 22:19 发表
http://man.chinaunix.net/newsoft ... nfig.html#customlog

還有 man rotatelogs

唉,你所了解的知识点,应该已经可以自己解决问题了,可是文档不是看报纸那种看法的啊 ...

非常感谢!惭愧惭愧!

apache除虚拟主机外的配置是

QUOTE:
CustomLog logs/access_log combined

虚拟主机的配置是

QUOTE:
<VirtualHost 192.168.x.x>
    ServerAdmin xx@xx.com
    DocumentRoot /var/www/html/xxx
    ServerName xx.xx.xx
    ErrorLog logs/xx-error_log
    CustomLog logs/xx-access_lg common
</VirtualHost>

是否要把虚拟主机里面的配置都改为:

QUOTE:
CustomLog "|bin/rotatelogs /var/logs/logfile 86400" common

可是虚拟主机的ErrorLog没有做什么修改,为什么自动rotate了呢?
ErrorLog 的问题不知道,按理说不应该啊

不过,"CustomLog "|bin/rotatelogs /var/logs/logfile 86400" common" 建议改为

"CustomLog "|bin/rotatelogs /var/logs/logfile.%Y%M%D 86400 4800" common"

因为我们是 GMT+8,

%Y%M%D 是举例,我不确定是不是这么写,具体的 timestr 还是看 manpage
这是apache里面log部分的配置:

QUOTE:
#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog logs/error_log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here.  Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
#CustomLog logs/access_log common

#
# If you would like to have agent and referer logfiles, uncomment the
# following directives.
#
#CustomLog logs/referer_log referer
#CustomLog logs/agent_log agent

#
# For a single logfile with access, agent, and referer information
# (Combined Logfile Format), use the following directive:
#
CustomLog logs/access_log combined

这是虚拟主机的配置:

QUOTE:
<VirtualHost 192.168.x.x>
    ServerAdmin xx@xx.com
    DocumentRoot /var/www/html/xxx
    ServerName xx.xx.xx
    ErrorLog logs/xx-error_log
    CustomLog logs/xx-access_lg common
</VirtualHost>

我猜想可能是日志里面这个common和combined的区别,这两个都是什么意思啊?