Search Our Database

Disable Mod Security for a Domain in cPanel

Last updated on |
by

Introduction

Mod Security serves as a crucial firewall for web applications, offering protection against various threats. However, certain scenarios might necessitate its temporary or permanent disablement for a specific domain in your cPanel. This guide provides a structured approach to achieving this, ensuring minimal impact on security while catering to your website’s specific needs.

 

Prerequisites

  • Root access to your server.
  • Basic familiarity with SSH and command-line operations.
  • cPanel & WHM installed on the server.

 

  1. Create directory at:
    [root ~]# mkdir -p /usr/local/apache/conf/userdata/std/2_4/username*/domain.com*
  2. Then create the mod_security.conf file:
    [root ~]# touch /usr/local/apache/conf/userdata/std/2_4/username*/domain.com*/mod_security.conf
  3. Edit the file and add the line below:
    [root ~]# vi /usr/local/apache/conf/userdata/std/2_4/username*/domain.com*/mod_security.conf
    ===cut===
    SecRuleEngine Off
    ===cut===
  4. Run this command to allow httpd.conf to include the file:
    [root~]# /scripts/ensure_vhost_includes –user=username*

 

Conclusion

Following these steps will disable Mod Security for your specified domain without affecting the overall security posture of other domains hosted on your server. This tailored approach ensures that you maintain the flexibility to address specific operational requirements or resolve compatibility issues with web applications.

 

For additional assistance or if you encounter any issues, please contact our support team at support@ipserverone.com.