Posted by: Mangesh_Linux_Administrator | March 2, 2011

Mod security ( How to disable it for a single domain)


Disabling Modsecurity for single domain==========

You can find the Apache version installed in the server by typing the following command.
httpd -V
Mod_Security rules can be disabled for a single domain in a cPanel server. To disable mod_security, please do the following steps:

For Apache Version 1.x:
Add the following directive in .htaccess file and upload it in to the document root directory of your domain:
<IfModule mod_security.c>SecFilterEngine OffSecFilterScanPOST Off</IfModule>

For Apache Version 2.x:
Create a directory for that domain under Apache conf directory as:
mkdir -p /usr/local/apache/conf/userdata/std/2/username/domainname
Then create a mod_security conf file:touch /usr/local/apache/conf/userdata/std/2/user/domainname/mod_security.conf
Add the following directive(s) in that file:
<IfModule mod_security2.c> <Location /directory name/ > SecRuleEngine Off</Location></IfModule>

Save the file and then run:
/scripts/ensure_vhost_includes –user=webrek

# restart httpd service

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: