Disable access_log and stop logging on CentOS how to

Welcome to another tutorial, this time it's a CentOS/Linux web-server tips, and we will learn how to disable and stop logging data to the access_log file on your VPS server or dedicated server.

By the time access_log file become heavy and take a big space, and if your hosting plan have a small disk space, like 10GB on my case, this is a big problem, and you must regularly delete the access_log.log file from your server, the solution is quite simple, just follow steps bellow and httpd apache will stop recording data to that file, so if you are sure that you don't need the data in that file go ahead and do this method:
  • First delete the access_log.log file which is located at this path: "/etc/httpd/logs/" on your server.
  • Now to stop httpd apache from writing data to that file again, just open the config file located on "/etc/httpd/conf/httpd.conf".
  • Now that the you open the httpd.conf using any editor, search for this line "CustomLog logs/access_log" and comment it to become like this "#CustomLog logs/access_log combined".
  • Now save the file and restart httpd service.
Thats it now lot of space is saved and you don't need to delete that file again, and on the same time the error log file is kept.


If you like this article, please share it on facebook, tweet it and +1 it to spread it :) !
Disable access_log and stop logging on CentOS how to Disable access_log and stop logging on CentOS how to Reviewed by Maherr Live on Sunday, April 01, 2012 Rating: 5