Configure the /etc/logrotate.d/apache file

Securing and Optimizing Linux: RedHat Edition -A Hands on Guide
Prev | Chapter 29. Software -Network Server, web/Apache | Next

# 29.10. Configure the `/etc/logrotate.d/apache` file

Configure your `/etc/logrotate.d/apache` file to rotate each week your Apache log files automatically. Create the `apache` file, touch `/etc/logrotate.d/apache` and add:

          /var/log/httpd/access_log {
          missingok
          postrotate
          /usr/bin/killall -HUP httpd
          endscript
          }

          /var/log/httpd/error_log {
          missingok
          postrotate
          /usr/bin/killall -HUP httpd
          endscript
          }

          /var/log/httpd/ssl_request_log {
          missingok
          postrotate
          /usr/bin/killall -HUP httpd
          endscript
          }

          /var/log/httpd/ssl_engine_log {
          missingok
          postrotate
          /usr/bin/killall -HUP httpd
          endscript
          }

Lines to automatically rotate the SSL log files named `ssl_request_log` and `ssl_engine_log` are included in this file. If you intend to run Apache without SSL support, you must remove the lines related to SSL.

Prev | Home | Next
Configure the `/etc/httpd/conf/httpd.conf` file | Up | Configure the `/etc/rc.d/init.d/httpd` script file