Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

29.21. Configure the new /etc/logrotate.d/apache file

Now Apache logs files residing in the /chroot/var/log/httpd directory instead of /var/log/httpd and for this reason we need to modify the /etc/logrotate.d/httpd file to point to the new chrooted directory. Also, we've compiled Apache with mod_ssl, so we'll add one more line to permit the logrotate program to rotate the ssl_request_log and ssl_engine_log files. Configure your /etc/logrotate.d/apache file to rotate your log files each week automatically.

Create the apache file, touch /etc/logrotate.d/apache and add:
        /chroot/httpd/var/log/httpd/access_log {
        missingok
        postrotate
        /usr/bin/killall -HUP /chroot/httpd/usr/sbin/httpd
        endscript
        }
        /chroot/httpd/var/log/httpd/error_log {
        missingok
        postrotate
        /usr/bin/killall -HUP /chroot/httpd/usr/sbin/httpd
        endscript
        }
        /chroot/httpd/var/log/httpd/ssl_request_log {
        missingok
        postrotate
        /usr/bin/killall -HUP /chroot/httpd/usr/sbin/httpd
        endscript
        }
        /chroot/httpd/var/log/httpd/ssl_engine_log {
        missingok
        postrotate
        /usr/bin/killall -HUP /chroot/httpd/usr/sbin/httpd
        endscript
        }
      

 
 
  Published under the terms of the Open Publication License Design by Interspire