- 论坛徽章:
- 0
|
RT!
服务器的虚拟站点中都定义了日志切割。但是在主配置文件httpd.conf中还定义了
<IfModule log_config_module>
#
#
# LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
# LogFormat "%h %l %u %t \"%r\" %>s %b" common
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
# You need to enable mod_logio.c to use %I and %O
#
# 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
CustomLog logs/access_log combined
#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog "|/usr/local/apache2/bin/rotatelog logs/access_log.%Y-%m-%d 86400" combined
</IfModule>
这个好处是可以直接得到一个合并起来的日志。
但是这个日志没有设置日志切割。我试图将
CustomLog logs/access_log combined
改成
CustomLog "|/usr/local/apache/bin/rotatelogs logs/access_log.%Y-%m-%d 86400" combined
而后重启httpd:
/usr/local/apache/bin/apachectl -k graceful
结果httpd挂了。网页打不开。。。
打开错误日志一看,全是:
piped log program '/usr/local/apache/bin/rotatelogs logs/access_log.%Y-%m-%d 86400' failed unexpectedly
Could not open log file 'logs/access_log.2010-12-28' (No such file or directory)
即使手动建立一个access_log.2010-12-28也没用!!!
求问该咋办???? |
|