How to Clear cPanel Error Log and Apache error Log files on a CentOs server. The cPanel automatically logs activity of a web server to make it easy for the administrator to find and correct broken links and other problems. After correcting what was causing these errors, it can be worthwhile to delete or remove the accumulation of errors from this log. The following covers specifically how I do this.
Note: The following assumes you have SSH (shell access) to your server.
Table of Contents
How to Clear Apache Error Log
To clear Apache error log,
- Login to your server using an SSH client.
- Then, from the terminal, type the following and press Enter
cat /dev/null> /usr/local/apache/logs/error_log
How to Clear cPanel Error Log and delete error_log files
To clear cPanel error log and delete PHP error_log files,
- From the terminal, type the following and press Enter,
find /home/*/public_html -type f -name error_log -delete
That's all there is to it. If all went well, your error logs should now be clean and related error_log files removed, until next time. ;)