I have a VPS account with CentOS Linux.
These two files are filling up the 20 GB hard drive every 24 hours:
This stats file:
/home/httpd/tanguay.info/stats/tanguay.info-error_log
and a file in this directory that seems to have different names when it appears but grows to 5+ GB in size:
/home/admin/__processed_stats
All I want to do right now it turn apache stats recording off so that my hard drive doesn't fill up and clobber my mail, ftp, etc.
So in the file:
/etc/httpd/conf/httpd.conf
I commented out the line:
#ErrorLog logs/error_log
Then I deleted both huge files above, rebooted the virtual machine, and saw that the first file (tanguay.info-error_log) had been recreated and was growing again.
So where do I turn off logging in Apache?
(or perhaps Apache is not even using this httpd.conf file as its configuration file, where is that saved?)
Two things get logged into the error log; errors from apache itself and a copy of stderr from any CGI or PHP application. You can reduce the errors from Apache by using the LogLevel option, but this usually accounts for very little of the logging. Mostly 404s. You'll probably find that most of it is generated by your applicatons.
The obvious thing to do would be to look to see what is in the error log and fix the problem. If it's giving you multi-gigabytes of logs a day, its trying to tell you something. Perhaps update your answer with a link to a snippet of your logs. That should allow us to give you more detailed responses.
(BTW, you only need to reload apache for it to pick up any configuration changes. There should be no reason to restart the entire server. )
Really, you need to do what David said, there's obviously a problem if you're getting that amount of logs. If you do however want to dump all your logs, on any UNIX machine you can just symlink your error logfile to /dev/null, effectively dumping them into the UNIX black hole.
On a Centos VPS if you're using the httpd rpm then it should definitely be loading it's config from /etc/httpd/conf/httpd.conf, however it may be including other files or directives after your ErrorLog line, check
httpd -S
to ensure there's no extra vhosts loading configuration later on.That log (
tanguay.info-error_log
) is clearly not generated by that configuration line (logs/error_log
). Is there another ErrorLog in httpd.conf, something in /etc/httpd/conf.d, or something somewhere else?httpd -S
could help.