15053971836 注册 / 登录

apache错误日志过大

时间: 阅读:376
apache错误日志过大

最佳回答

夲人出租

夲人出租

2023-01-13 07:10:02

根源上讲,你的看看错误日志文件中的报错类型,是因为什么原因导致抛了这么多错误,不要一味的去删除日志,这次删了,过几天又涨上来
所以根本的问题在于看看抛的是啥错误日志,从根源上解决。
如果还是不行,把错误日志贴上来,大家一起看看。

最新回答共有2条回答

  • 游客
    回复
    2023-01-13 09:09:04

    删除 Apache2/logs/目录下的 error.log、access.log文件
    打开 Apache 的 httpd.conf配置文件并找到下面两条配置
    ErrorLog logs/error.log
    CustomLog logs/access.log common
    直接注释掉,换成下面的配置文件。
    # 限制Apache错误日志文件为 1M
    ErrorLog “|bin/rotatelogs.exe -l logs/error-%Y-%m-%d.log 1M”
    # 每天生成错误日志文件
    #ErrorLog “|bin/rotatelogs.exe -l logs/error-%Y-%m-%d.log 86400″
    # 限制访问日志文件大小为 1M
    CustomLog “|bin/rotatelogs.exe -l logs/access-%Y-%m-%d.log 1M” common
    # 每天生成一个访问日志文件
    #CustomLog “|bin/rotatelogs.exe -l logs/access-%Y-%m-%d.log 86400″ common