Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2011
    Posts
    32

    How to remove cpanel and apache log files using command line

    Hi,


    Help needed, need a command line to remove cpanel and apache log from the server. thanks

  2. #2
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    9,072
    rm -rf /usr/local/cpanel/logs/
    rm -rf /usr/local/apache/logs/
    rm -rf /usr/local/apache/domlogs (Individual website logs)

    I won't ask why... but there you go! Make sure you restart both cPanel and Apache to resume logging.
    RACK911 Labs | Penetration Testing | https://www.RACK911Labs.ca

    www.HostingSecList.com - Security Notices for the Hosting Community.

  3. #3
    Join Date
    Dec 2011
    Posts
    32
    Quote Originally Posted by Patrick View Post
    rm -rf /usr/local/cpanel/logs/
    rm -rf /usr/local/apache/logs/
    rm -rf /usr/local/apache/domlogs (Individual website logs)

    I won't ask why... but there you go! Make sure you restart both cPanel and Apache to resume logging.
    I can't access Cpanel anymore .

  4. #4
    Try to recreate the deleted directories:

    mkdir /usr/local/cpanel/logs/
    mkdir /usr/local/apache/logs/
    mkdir /usr/local/apache/domlogs/

    and restart cPanel and Apache.
    ---=== RoseHosting.com Admin ===---
    Linux Server Management and Outsourced Web Hosting Support - linuxhostsupport.com
    Managed Linux VPS Hosting - rosehosting.com
    High Quality Linux virtual servers with lots of Guaranteed RAM and SSD space, Impeccable Service.

  5. #5
    Have you contacted WHM/cPanel Inc.? Re-creating manually dirs might not work, as something else might be missing. You could try what RoseHosting said though.
    BeltHosting.com Staff. Shared Web Hosting | Reseller Web Hosting | IRCD Hosting | psyBNC/sBNC/eggdrop/znc Hosting
    xShellz Linux Shell & IRCD Hosting.
    24/7 Live & Ticket Support

  6. #6
    Was there any specific reason to delete those logs? I think recreating deleted log files with proper permissions should fix the issue.
    || Web Hosting Blog - Web Hosting security & latest web hosting industry Announcements
    || Web Hosting Discussion - A Web Hosting community

  7. #7
    Try it by recreating the files/folder and run an upcp along with easyapache which should fix the issue.

  8. #8
    Join Date
    May 2013
    Location
    India
    Posts
    747
    Make sure you know what you are doing before running any commands! Also note that removing domlogs will flush the stats for all domains since last log processing. Recreating log dirs as RoeHosting said should fix the issue, unless you did anything else on the server. Just wondering why you need to clear the logs though.

Similar Threads

  1. ip blocked in csf/lfd how to remove from command line?
    By akasharya in forum Hosting Security and Technology
    Replies: 13
    Last Post: 05-28-2015, 04:32 AM
  2. Shell Command to remove older files
    By xs-admin in forum Programming Discussion
    Replies: 6
    Last Post: 07-18-2012, 11:56 AM
  3. add /remove blocks of IP via command line
    By NoAgendas in forum Hosting Security and Technology
    Replies: 5
    Last Post: 08-14-2006, 03:21 PM
  4. perl - remove line command
    By NetCloud in forum Programming Discussion
    Replies: 8
    Last Post: 08-20-2004, 10:22 AM
  5. If a user doesn't need log stats, can you remove log path from apache?
    By DWHS in forum Hosting Security and Technology
    Replies: 3
    Last Post: 04-04-2003, 11:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •