zoukankan      html  css  js  c++  java
  • Apache下error.log文件太大的处理方法

    清除error.log、access.log并限制Apache日志文件大小的方法,在网上搜了下相应的资料,并按照如下步骤做了一遍,网站恢复正常
     

    清除error.log、access.log并限制Apache日志文件大小的方法
    有个客户反映vps网站打不开,登录系统检查下,客户是win2003系统,发现放置网站文件的D盘已被占满,可用空间为0KB,进去发现客户Apache服务器的错误日志error.log非常的大,造成D盘被爆满。

    在网上搜了下相应的资料,并按照如下步骤做了一遍,网站恢复正常

    第一步:停止Apache服务的所有进程,删除 Apache2/logs/目录下的 error.log、access.log文件

    第二步:打开 Apache 的 httpd.conf配置文件并找到下面两条配置

    ErrorLog logs/error.log
    CustomLog logs/access.log common

    直接注释掉,换成下面的配置文件。


    # 限制错误日志文件为 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

  • 相关阅读:
    【Linux题目】第七关
    【Linux题目】第六关
    【Linux题目】第五关
    【Linux常见命令】tar命令
    【Linux题目】第四关
    【linux题目】第三关
    【Linux删除问题】Operation not permitted
    【linux题目】第二关
    【linux题目】第一关
    java加密类Cipher的使用
  • 原文地址:https://www.cnblogs.com/BTMaster/p/3488084.html
Copyright © 2011-2022 走看看