Apache logs too big. Filesystem full

Discussion in 'Site & Server Administration' started by mariusiacob, Jan 16, 2012.

  1. #1
    Hi everyone . Need some help

    I have apache running on FreeBSD . when trying to restart the web server I get /var : filesystem full.

    When doing a du I get that /var/log/httpd-access.log is 109% .

    My question is : how do you clear this , or should I just delete the file and create another one ?


    Please help
     
    mariusiacob, Jan 16, 2012 IP
  2. supportex

    supportex Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #2
    If you don't need it you can do just:

    > /var/log/httpd-access.log

    After that you might need to setup logs rotation.
     
    supportex, Jan 16, 2012 IP
  3. mariusiacob

    mariusiacob Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thx Supportex ,


    but what does that command do , it looks like redirection? I do not need anything in that file. I just don't know if deleting that file will cause apache to stop working . I could delete it and create a blank file in its place . will that work ?
     
    mariusiacob, Jan 16, 2012 IP
  4. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #4
    Hi there,

    You can use the echo command to clear it out:

    echo > /var/log/httpd-access.log
    Code (markup):
    This will clear out the log itself, and ensure the file and permissions for it stay the same.

    Regards,
    Chris
     
    RHS-Chris, Jan 16, 2012 IP
  5. lachrymologist

    lachrymologist Active Member

    Messages:
    456
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    70
    #5
    don't delete it, just empty it as the fellow above suggested.
     
    lachrymologist, Jan 16, 2012 IP
  6. ideamine

    ideamine Member

    Messages:
    83
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    28
    #6
    What "> /var/log/httpd-access.log" does is enter null value to that file .. which is equivalent to "create a blank file in its place" :)
     
    ideamine, Jan 30, 2012 IP