Delete all files
Use the following command to remove all the files and directories inside your apache2 log.
You may want to reload it after deleting.
rm -rf /var/log/apache2/*
Code language: JavaScript (javascript)
Reload Apache
/etc/init.d/apache2 restart
Logrotate
Ideally you want to install an utility such as Logrotate so it can do it for you. You can set up the intervals, the file size, etc...
Thanks a lot man. You saved my day, and my Ubuntu. My logs where 13 GB so I removed them but the space wasn’t freed up even the logs folder was absolutely empty. I’ve tried restarting apache, but nothing worked, nothing but the reload command you’ve posted here. Thanks again.
I’m glad it worked dude 😉