Home » Digital Culture, Featured, Hardware, Startup Tips, Startup Tools
cPanel WHM Delete Apache Logs SSH
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.
Related articles by Zemanta
- List of cPanel / WHM Inbound and Outbound Ports (geekology.co.za)
- Restore Full cPanel Backup (momblognetwork.com)
- The Planet Now Offers Free Cloud Storage (java.sys-con.com)
, Server
, shell access
, SSH
, Web Design and Development
, Web hosting service
, WHM 

![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=906831ec-b487-4247-bcb4-916e36199d14)











[...] 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 [...]
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!
Tech Cloud
Tech Categories
Archives