Disable Mod Security for a website or cpanel account

by rajesh 2012-04-05 16:23:07


Some website might face issues in running cron file or files sending password via url if in case mod security is enabled in the server.

We can disable mod security for a specific site or a cpanel account as follows

1) Edit httpd.conf and search for the site

2) Uncomment the line that start as Include for that site

3) Copy the directory path that is mentioned in the include line and create the dir using the command
replace username with cpanel username and sitename with website name in the below commands

mkdir -p /usr/local/apache/conf/userdata/std/2/username/sitename/
cd /usr/local/apache/conf/userdata/std/2/username/sitename/


4)crate a conf file using vim command
vim diable-modsec.conf


5) Add the following code in the file
<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>


6) Restart httpd

/etc/init.d/httpd restart
1454
like
1
dislike
0
mail
flag

You must LOGIN to add comments