#1 (permalink)  
Old 11-17-2007, 11:34 AM
Registered User
 
Join Date: Apr 2003
Posts: 20
Kh@lid
How to disable mod_security2 rule for one domain?

Hello,

I'm getting this error message:
Code:
Not Acceptable

An appropriate representation of the requested resource /admin/index.php could not be found on this server.
And I've been told that I have to add this in .htaccess:
Code:
<IfModule mod_security.c>
   SecFilterEngine Off
   SecFilterScanPOST Off
</IfModule>
Which is impossible now.

I've tried to add it in httpd.conf but didn't solve the problem.

How can I solve this? OR Disable mod_sec on one domain?
__________________
Regards,
Khalid
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-25-2007, 01:40 PM
Registered User
 
Join Date: Mar 2004
Location: India
Posts: 6
bidhata
Post

Code:
<IfModule mod_security.c>
SecRuleEngine Off
</IfModule>
this will work ...
__________________
Impossible = "I" "m" "Possible".
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-04-2007, 12:39 PM
Registered User
 
Join Date: Apr 2004
Posts: 9
vittle
Quote:
Originally Posted by bidhata View Post
Code:
<IfModule mod_security.c>
SecRuleEngine Off
</IfModule>
this will work ...
This does not seem to work after a while. Instead, we used this method to disable it for specific domains:

The only way to bypass mod_security2 in Apache 2 is to manually edit httpd.conf. However, as cPanel autogenerates this, one must directly edit the httpd template files that cPanel uses to generate the httpd.conf. Namely, in /var/cpanel/templates/apache2/vhost.default

Add the following line before the </VirtualHost> closing tag


Code:
[% IF vhost.servername == 'domain.com' || vhost.servername == 'domain2.com' -%]
## CUSTOM RULE BY POLURNET.COM TO BYPASS MOD_SECURITY2 FOR SPECIFIC DOMAINS
<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>
[% END -%]

After adding this, you must also remember to re-generate the template (run /usr/local/cpanel/bin/build_apache_conf) and restart Apache/httpd, otherwise changes won't take effect.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-04-2007, 12:49 PM
Registered User
 
Join Date: Aug 2002
Posts: 1,068
sparek-3 is on a distinguished road
Just create a directory:

mkdir -p /usr/local/apache/conf/userdata/std/2/username/domain.com

Then create a file:

/usr/local/apache/conf/userdata/std/2/username/domain.com/mod_security.conf

In that file add:

<IfModule mod_security.c>
SecRuleEngine Off
</IfModule>


Save it.

Then run:

/scripts/ensure_vhost_includes --user=username
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-08-2009, 10:06 AM
Registered User
 
Join Date: Apr 2007
Posts: 6
ovisopa is on a distinguished road
Any new/simple way to disable mod_security2 for just one domain .. after 2 years of this thread was started ??

I'm using cPanel 11.24.4-S35075 - WHM 11.24.2 - X 3.9
Apache2 / suPHP / mod_security2

I found a comment on a blog:

SecRule SERVER_NAME “domain.com” phase:1,nolog,allow,ctl:ruleEngine=off

this should be added to modsec2.conf ?

For now, to solve the problem one website had with a flash uploader I have removed the rule marked with red, on the bellow code

#spam bots
SecRule HTTP_User-Agent "DTS Agent"
SecRule HTTP_User-Agent "POE-Component-Client"
SecRule HTTP_User-Agent "WISEbot"
SecRule HTTP_User-Agent "^Shockwave Flash"
SecRule HTTP_User-Agent "Missigua"


10x
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 02:36 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc