While setting up the Apache HTTP server in AIX, I never realize there is a log file, access_log
, located at /var/log/httpd. This file is keep growing until 600+ MB, I am not able to keep track of its growing and may bring other issues in the future, may I know can I stop growing the file?
-
2Shut down the web server. Then the log will stop growing. – Michael Hampton Apr 2 '13 at 5:48
-
I can't stop the server as I am still using it. How could I write an auto clean script on the file so that I could maintain the file size? – huahsin68 Apr 2 '13 at 5:49
Use something like logrotate, or the rotatelogs utility that came with Apache, to rotate your log files on a regular basis.
I don't know about AIX but on other platforms the common way to handle that issue is to rotate the logs.
logrotate and it's configuration at /etc/logrotate.conf is the most common way to do that.
It looks like that is supported on AIX: http://www-01.ibm.com/support/docview.wss?uid=isg3T1012796
Check the file httpd.conf (or apache2.conf), find the logging related entries and disable them.