obey-robots.txt
View Thread
Web Master Trouble » Linux Apache MySQL PHP optimalisation tips tricks » Linux tutorials, Tips & Tricks
Was this usefull?
Yes Yes 100%[1 Vote]
No No 0%[0 Votes]
Total Votes : 1
 Print Thread
Solution for very large mod_security modsec_audit.log
webmastertrouble
An other annoyance of mod_security is the very large modsec_audit.log. In my case it was almost 3GB in size.
The solution for this is to use logrotate.

cd /etc/logrotate.d/
touch modsecurity

/var/log/modsec_audit.log {
    daily
    rotate 1
    compress
    missingok
    notifempty
    sharedscripts
    postrotate
    /usr/sbin/apachectl graceful > /dev/null 2>/dev/null || true
endscript
}
# custom script by WebmasterTrouble for keeping modsec_audit.log from growing.


Don't want to wait until your server rotates the logs? Then force a log rotate now by executing the command below:

logrotate -f /etc/logrotate.conf


Check your /var/log directory! :)

Your apachectl could be located somewhere else! So check the path with:

whereis apachectl

Now the path is shown. Update this path in the above logrotate file.
 
Jump to Forum
New Thread Post Reply
Use BBcode or HTML to refer to; 'Solution for very large mod_security modsec_audit.log'
BBcode:
HTML:
Simular threads
Subject Discussion Forum         Last Post
Solution for error ModSecurity: collections_remove_stale: Failed deleting collection Linux tutorials, Tips & Tricks : 1 04-01-2015