Want to rotate apache error logs on Apache 2 webserver? There is a nice bash script you can use. Basically it works by stopping apache webserver and backing up your error logs and access logs (based on date), and then removing the original apache logs then starting apache again. You can use this script alongside with cron for automatic rotation. Create /usr/archive folder first if it doesn’t exists.