Quantcast

cPanel WHM Delete Apache Logs SSH

Feb 9, 2010 | 2 Comments |
|  

By Senior Editor Kris Smith (@croncast)

If you host your site on a box that has Web Host Manager (WHM) or cPanel on it this post is for you.

Since quite a few independent developers, indie hosting companies and startups do, I wanted to share this very important command for removing Apache logs under WHM.

Some tasks are very easy to complete under WHM by design and others are just so difficult that you wish you had never installed the stupid thing. But if you’ve got an issue with logs or clients that are filling them up quickly on your server and you need an instant solution – behold:

echo ” “> /usr/local/apache/logs/error_log

The offending partition will zap the logs and go back to running normally without an Apache restart. Though, a restart isn’t going to hurt anything if you run one manually.

WHM and cPanel make hosting sites easier with improved user interfaces and features that automate what can typically be tedious and mundane tasks that will keep the server updated. However, there are some functions that fall through the cracks and Apache logs is one of them when an application on the box gets out of control.

In many cases the offending app under WHM are the cPanel accounts for Awstats. The line above executed in SSH becomes a band aid that will get you into position to troubleshoot accounts.

Reblog this post [with Zemanta]
Tags: , , , , , ,

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

2 Comments »

  • Tweets that mention cPanel WHM Delete Apache Logs SSH | Tech Startups -- Topsy.com said:

    [...] This post was mentioned on Twitter by journalist ville.ag, TechStartups.com. TechStartups.com said: New post: cPanel WHM Delete Apache Logs SSH – http://bit.ly/d7Hrls [...]

  • David Grega said:

    An alternate solution is to enable log rotation for error_log by going to WHM -> Service Configuration -> Apache Configuration -> Log Rotation. Currently, log rotation occurs once error_log exceeds 300 MB in size.

    If you feel the server will never need to reference old entries in error_log, just create a cron job to empty /usr/local/apache/logs/archive/ periodically.

    If there’s ever anything in our software that causes inconvenience, please feel welcome to contact us so we are aware of such issues and can work to improve cPanel and WHM.

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.