Page 1 of 1

Disk space filling with apache logs

Posted: Fri Aug 22, 2014 5:10 am
by stebbo
Hi All,

I've been getting warnings from the localhost system regarding the falling amount of free space on my system. I only have an 8GB hard drive, and a little bit of exploring shows me that I have 2.6GB taken up by the apache log files in /var/log/httpd

How can I reduce the size of these log files? The system appears to be keeping the last 4 week's worth of log files in addition to the current file, each around 500-700MB in size.

Thanks in advance,
Chris.

Re: Disk space filling with apache logs

Posted: Fri Aug 22, 2014 12:14 pm
by abrist
What is in those log files? I bet there are a few lines that repeat ad nauseam. Could you take a look at the logs and post any oft-repeated lines?

Re: Disk space filling with apache logs

Posted: Fri Aug 22, 2014 8:14 pm
by stebbo
Hi abrist,

there are lots of lines that are very similar. many like

Code: Select all

10.174.64.33 - - [17/Aug/2014:03:04:03 +1000] "GET /nagiosxi/ajaxhelper.php?cmd=getxicoreajax&opts=%7B%22func%22%3A%22get_service_status_state_summary_html%22%2C%22args%22%3A%7B%22hostname%22%3A%22localhost%22%2C%22servicename%22%3A%22Root%2BPartition%22%2C%22service_id%22%3A%2291%22%2C%22display%22%3A%22simple%22%7D%7D&nsp=b27d5f7810e119ffb956ba77ac197952 HTTP/1.1" 200 364 "http://nagios.lilydalehs.vic.edu.au:8080/nagiosxi/includes/components/xicore/status.php?show=servicedetail&host=localhost&service=Root+Partition" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
and more like

Code: Select all

10.174.64.182 - - [17/Aug/2014:03:04:08 +1000] "GET /nagiosxi/ajaxhelper.php?cmd=getxicoreajax&opts=%7B%22func%22%3A%22get_host_status_attributes_html%22%2C%22args%22%3A%7B%22hostname%22%3A%22Library+Kiosk%22%2C%22host_id%22%3A%22268%22%2C%22display%22%3A%22all%22%7D%7D&nsp=4ad18112156a9a4ccf8d2985151b056d HTTP/1.1" 200 2405 "http://nagios/nagiosxi/includes/components/xicore/status.php?show=hostdetail&host=Library+Kiosk" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"
I gather this is logging every single request - come to think of it I have a few machines around the place continually logged in on my dashboard page which is a minemap of the entire installation. from the above it seems every refresh of each of the couple of hundred green/red lights is logged?

Cheers,
Chris.

Re: Disk space filling with apache logs

Posted: Fri Aug 22, 2014 8:35 pm
by stebbo
I'm thinking I can probably just turn off these logs and turn them back on again if I'm interested in looking at them in the future.

How might I go about turning off logging to the access_log files?

Cheers,
Chris.

Re: Disk space filling with apache logs

Posted: Mon Aug 25, 2014 10:17 am
by sreinhardt
I would personally suggest setting up a 5-7 day log rotate instead, but if you really wish to disable them entirely. You are going to want to modify /etc/httpd/conf/httpd.conf and look for the CustomLog and ErrorLog directives. Simply commenting them out with # first should do the trick after an apache restart.

Re: Disk space filling with apache logs

Posted: Wed Aug 27, 2014 5:03 pm
by stebbo
Hi sreinhardt,

thanks for the response. I I'll look into log rotate. For the moment I've lowered the logging level to error rather than warning and will see what that produces.

Cheers,
Chris.