Web Master Trouble
Users Online
Guests Online: 1

Members Online: 0

Total Members: 3
Newest Member: Proxyhotdeals


Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Last Seen Users
Your ad here below
View Thread
Web Master Trouble » Linux Apache MySQL PHP optimalisation tips tricks » Linux tutorials, Tips & Tricks
Linux tutorials, Tips & Tricks Getting started with SSH An introduction to NGINX, PHP-FPM and MariaDB on CentOS An introduction to NGINX, PHP-FPM and MariaDB on Ubuntu Getting started with OpenVZ! Handle DNS properly with cPanel Munin amass, all your server charts in one place Monitoring server performance with Munin! Getting started with OpenVPN (client) Getting started with OpenVPN (server) Your own mail server with Virtualmin IPtables: IPv6 and more rules
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

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
Download source  Code
/var/log/modsec_audit.log {
    rotate 1
    /usr/sbin/apachectl graceful > /dev/null 2>/dev/null || true
# 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:
Download source  Code
logrotate -f /etc/logrotate.conf

Check your /var/log directory! :)

Your apachectl could be located somewhere else! So check the path with:
Download source  Code
whereis apachectl

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