How to Enable or Disable Mod Security in cPanel Print

  • 0

Updated guide: This article has been refreshed for current hosting environments. Control-panel labels and available features can vary slightly by account, server configuration, or software version, but the workflow below follows the current approach used on modern hosting platforms. This guide is written to help you complete How to Enable or Disable Mod Security in cPanel safely and understand what to check if the expected result does not appear.

Before you begin

  • Confirm the domain resolves to the correct service.
  • Check whether the certificate is issued by AutoSSL, a commercial CA, Cloudflare or another provider.
  • If Cloudflare is used, check both the visitor-to-Cloudflare certificate and the Cloudflare-to-origin connection.
  • Do not install multiple competing SSL configurations without first identifying which system is responsible for renewal.

HTTPS and Cloudflare

Modern Cloudflare deployments can involve two TLS connections: the visitor connects to Cloudflare and Cloudflare connects to the origin server. Cloudflare provides Universal SSL for supported proxied hostnames, while the origin still needs an appropriate certificate when the selected SSL/TLS mode requires encrypted communication to the server. Keeping the origin certificate valid avoids common 52x and SSL-related errors.

SSL troubleshooting

  • Certificate is not issued: Verify that the domain resolves correctly and that certificate validation can reach the expected DNS or HTTP validation path.
  • Browser shows mixed content: Make sure the site and its assets load over HTTPS. Update hard-coded HTTP URLs in the application or database where appropriate.
  • Cloudflare shows an SSL error: Confirm that the origin server has a valid certificate and that the Cloudflare SSL/TLS mode matches the origin configuration.
  • Certificate expired: Check AutoSSL status or the certificate provider renewal process rather than installing a replacement certificate blindly.

When to contact support

Contact support when the required feature is unavailable, a server-level service is failing, an account is locked, a restore requires privileges you do not have, or you have verified the settings but the service still does not work. When contacting support, include the domain name, the exact error message, what you changed, when the issue started, and screenshots or log output where appropriate. Do not send passwords or other authentication secrets.

Original illustrated procedure

Are you facing the issue of IP getting blocked repeatedly? If the answer is Yes, then it may have happened due to Mod Security.


What is Mod Security?
ModSecurity is a module that protects your website from various types of attacks. Mod Security protects a website from hackers, brute force attacks, cross-site request forgery(CSRF), and many other threats. Although it sometimes creates a problem, we do not recommend you to disable it but instead fix your software's vulnerability.


Disabling ModSecurity can help you determine whether ModSecurity blocks your IP or not. However, if your IP is blocked for a different reason, then contact us. We will find the exact reason behind it in order to resolve your issue so that you will not be required to disable the module.


How to Enable or Disable Mod Security in cPanel?
1. Log in to your cPanel account.


2. In the Security section, click on ModSecurity.
mod-security-icon.gif

3. If ModSecurity is enabled, it shows the Disable option. Click it to disable ModSecurity on all domains. The next time you want to enable it, click on Enable to enable it on all domains.
disable-modsecurity-in-cpanel.gif


How to disable ModSecurity only on selected domains?
You may have multiple domains, and you would want to disable or enable ModSecurity on selected domains.

1. Log in to cPanel, and from the Security section, click on ModSecurity.


2. Scroll down to the bottom of the page.


3. Under the Status option, next to the domain, click on On or Off.

modsecurity-disable-selected-domain-cpanel.gif


Was this answer helpful?

« Back