Forum Moderators: phranque
I run Apache web server on FreeBSD.
I do not use the Log file for anything, so if its possible to stop generating the Log file?
Now i have to login to the server and delete the log files at times. I know i can get it auto delete, but not sure how to do this.
Also a small shell script like
apachectl stop
rm -f *.log
apachectl start
on cronjob will do, but i don't want to take risk, if apache won't start.
Regards,
Yujin
I don't think it is required to have Apache generate logs. You could simply make a back-up copy of httpd.conf and then comment out the lines relating to log generation. If Apache refuses to restart, then switch back to your backup httpd.conf.
If you can't find a way of stopping the generation of the logs, you can simply symlink access.log to /dev/null. Personally, I would at least keep error.log in case of problems.
/var/log/httpd/*.log 644 6 * $M1D0 BG /var/run/httpd.pid 30 Look in
man 5 newsyslog.conf to see what the fields mean. Basically I rotate all the logs in /var/log/httpd at the start of every month. After the logs have been moved, Apache is sent signal 30, telling it to reopen its log file, ie create new empty logs. The last 6 log files are kept. Any older are deleted. References:
[httpd.apache.org...]
[httpd.apache.org...]
[freebsd.org...]