Bash Script - Whitelist an account in Mod Security

The following script disable Mod Security for an account.

mkdir -p /usr/local/apache/conf/userdata/std/2/$1/$2

echo -e " \nSecRuleEngine Off \n" > /usr/local/apache/conf/userdata/std/2/$1/$2/mod_security2.conf

/scripts/ensure_vhost_includes --user=$1

echo "Mod security disable for the account:$1 successfully"

Note:- Copy the above commands in a .sh file. Here let it be then,

# chmod 755
    -To give execute permission to the script.
# ./ <user_name>  <domain_name>
    -Execute the command as shown above.

This entry was posted by Arun Ghosh. Bookmark the permalink.