Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Aug 2004
    Posts
    174

    Default Disbale mod security for 1 site

    Hi I am using apache 2.2 and mod security 2 with the default configs, my problem is that one site is using a php to call a jpg image but mod security keeps blocking it, I wanted to add the SecFilterEngine off to the htacess file but everytime I do it I get 500 internal server error for the whole site. Is there a way to disable mod security just for this site?

    Thanks

  2. #2
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Aug 2007
    Location
    Toronto, Canada
    Posts
    32

    Default

    Edit httpd.conf and add the following into site VirtualHost entry:

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

  3. #3
    Member
    Join Date
    Aug 2004
    Posts
    174

    Default

    Thanks a lot it works like a charm

  4. #4
    Member
    Join Date
    Oct 2005
    Posts
    7

    Default

    This may get lost after cpanel updates. Please see the link below:

    http://forums.cpanel.net/showthread....=mod_security2

  5. #5
    Member
    Join Date
    Aug 2004
    Posts
    174

    Default

    After a while I have added the rule and now it doers not seem to work can anyone help me please? I addedd to one of my vhosts
    <IfModule mod_security.c>
    SecRuleEngine Off
    </IfModule>

    on /etc/httpd/conf/httpd.conf restarted apache but it is not working should I put in another place?

    THANKS

  6. #6
    Member
    Join Date
    Aug 2004
    Posts
    174

    Default

    Ok found the new code just put it in /etc/httpd/conf/httpd.conf before the </virtualhost> of the domain you want to disable it:

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

    Thanks

  7. #7
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Exclamation

    Blindly turning off mod_security entirely, even for one site, just because a rule triggers is for lack of a better word "stupid" to say the very least!

    Don't turn off mod_security as that utterly defeats the point of having mod_security setup on your server in the first place! Subsequently, disabling one site leaves enough of a hole that the whole entire server may as well not have mod_security installed or enabled and may as well remove it entirely!

    If you have a problem with a rule triggering, I suggest either rewrite the specific rule so that it doesn't trigger for that specific site or content or disable the offending rule (did you know you can disable individual rules?) and just that rule only --- leaving the rest of mod_security fully running!

Similar Threads & Tags
Similar threads

  1. Mod Security
    By aaronkolodjski in forum Security
    Replies: 7
    Last Post: 12-20-2009, 06:50 PM
  2. Mod Security?!
    By reporter in forum cPanel and WHM Discussions
    Replies: 15
    Last Post: 11-18-2009, 05:16 PM
  3. Mod security
    By black&white in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-19-2008, 12:16 PM
  4. Mod Security 2.5, or 2.0?
    By sh4ka in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 04-21-2008, 12:20 PM
  5. Simple security question about mod-security rule sets.
    By jols in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-09-2007, 05:37 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube