The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Nearly Full /usr due to huge apache and cpanel folder

Discussion in 'General Discussion' started by caylean, Jul 24, 2015.

  1. caylean

    caylean Member

    Joined:
    Jul 2, 2013
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello together, I receive since July 1st the diskwarn Message that my /dev/sda6 /usr would be full.
    First diskwarn message came on 1st July 2015 at 10:46 with 79%
    First diskcritical message came on 1st July 2015 at 10:51 with 89%
    As i had no clue what was going on i just did nothing.
    On 4th July i received a diskwarn again with 77%
    Either my Hoster had handled the critical, or the server did it on its own. As it does not stop sending messages i came to the conclusion i can't sit that out :)

    So I have managed to find out what files/folders are causing my full partition, but well, now i am not certain how to figure out whats okay to delete and whats not and how to avoid problems in the future.

    Before i start now several topics to get things cleaned up again, i thought i might just put it all together. To keep things clean i just sum up the files/folders that are the largest in size and not just everything. Would get kind of messy I think.

    XXXXXXX@host [~]# df -h
    /dev/sda6 20G 16G 3.0G 85% /usr

    XXXXXXX@host [/usr]# du -sh *
    14G local

    XXXXXXX@host [/usr/local]# du -sh *
    6.9G apache
    6.0G cpanel
    2.7M maldetect.bk****** (53 files like that, in sum 146.8M)

    XXXXXXX@host [/usr/local/apache]# du -sh *
    6.8G logs

    XXXXXXX@host [/usr/local/apache/logs]# du -sh *
    121M error_log
    136M access_log
    6.5G suphp_log

    XXXXXXX@host [/usr/local/cpanel]# du -sh *
    370M src
    439M modules-install
    932M 3rdparty
    1.3G base
    1.4G bin

    In cpanel i have only copied the largest files/folders

    To sum it all up:

    1st Taking into account that cpanel is what keeps everything running and working, I might assume that this should/could be fine as it is, but I am totally not sure about that. Minimizing that would maybe help to keep some more free space.
    Am i right here?

    But mainly, how can I avoid that the suphp_log gets that bloated? Is there any way to set a maximum size for that file and that it just drops the oldest entries or something?
    I know the best way will properbly be to fix the errors, but well, thats properbly waaay up ahead of me, basic html and css is all i can do .. thats why all thats running on the server is a huge MultiWP, some single WP and Toplists. Fixing these to avoid any errors will be not really something I would be able to do under normal circumstances.

    A download of the suphp_log will be also not possible, as my internet connection would take days for it, and end up in hundreds of disconnects in between. Doing the console search for the files/folders that cause the Problems ended in 12 console restarts (due to disconnects).

    2nd How would I be able to savely delete the error log? (So that i can wait that it fills up again and i would be able to download it when it is just some M large)

    3rd Whats up with all these maldetect.bk1234 files? Could they be deleted too? Is there anything else to do with? Maldetect sounds so much like Malware Detect, if so, if these are detected Files shouldn't i have gotten an Email that tells me there was something?

    Help would be really appreciated.
     
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    rotate your logs either via cpanel's built it system or via /etc/logrotate.conf
     
    caylean likes this.
  3. caylean

    caylean Member

    Joined:
    Jul 2, 2013
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    After reading about logrotation it sounds really nice and even what i needed to solve the second Question, thanks.

    Checked my WHM for it and i think you mean "cPanel Log Rotation Configuration" ?

    If so, it is nearly all marked. The only ones that are NOT marked are "cpbackup_transporter.log, cpdavd_session_log, panic_log, setupdbmap_log"
    An entry for suphp_log i could not find here. In case there is a command line tutorial (explanation) for that i still have to search it, as i have no idea what i would be doing otherwise ;)

    Edit
    Just found the Option to add suphp_log

    Apache Configuration » Log Rotation
    Here I am able to add the following Logs to the rotator:
    modsec_debug_log
    suexec_log
    suexec_log.offset
    suphp_log
    I will add suphp_log directly.

    Edit 2
    I have just added the suphp_log to the rotator and ran the logrotate via commandline "logrotate -f /etc/logrotate.conf" looks like it was correct, as my Disk Usage shows now:
    Device: /dev/sda6 - Size: 20G - Used: 9.5G - Available: 9.3G - Percent Used: 51% - Mount Point: /usr
    Thank you very much dalem!
     
    #3 caylean, Jul 24, 2015
    Last edited: Jul 24, 2015
  4. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    Your welcome
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    652
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page