Log Files
May 9, 2005 Posted by KP
I deleted the log files of Postfix and Apache manually, these files weren’t re-created even after I restarted Postfix and Syslogd, and it ended with a system reboot. I need to find a good way to rerotate Apache log files.
Update: Apache will create the new log files after restarting, a graceful restart is perferred.
# /usr/local/sbin/apachectl graceful
Check out Apache Log Rotation for more info.
Related Posts:
- Disable Apache Log Files
- Commonly Used Configuration Files and Commands
- More About Apache Log File Rotation
Filed Under: FreeBSD General
May 16th, 2005 at 7:20 pm
I use the rotatelog program, which works great.
Example:
CustomLog “|/usr/local/sbin/rotatelogs /path/to/log/logfilename 86400 -240″ combined
This will make a new log each day. The -240 is an offset for your timezone.
May 16th, 2005 at 7:58 pm
Many thanks for your info, yegg, your suggestions are very helpful. I seem to find the reason of the spams mails, the mail server past open relay test on a website, but it seems I can send an email according to your telnet example with the email address www@myhost.com. I need more work and will post the result later.