How to Enable or Disable ModSecurity (cPanel & DirectAdmin)
Evans
Last Update hace 2 meses
What is ModSecurity?
ModSecurity is a web application firewall (WAF) designed to protect websites from:
SQL injection
Cross-site scripting (XSS)
CSRF attacks
Brute-force attempts
And other known exploits
While helpful, ModSecurity can sometimes block legitimate requests, especially from CMS dashboards like WordPress, Joomla, or some web apps. If you're seeing frequent "403 Forbidden" errors or getting blocked unexpectedly, ModSecurity could be the cause.
đź”” Note: Disabling ModSecurity is not generally recommended unless for troubleshooting. Always ensure your website is up-to-date and secure.
How to Enable or Disable ModSecurity in cPanel
Log in to your cPanel account.
Scroll to the Security section.
Click on ModSecurity.
You’ll see a list of your domains and an option to Enable or Disable the feature globally.
Click Disable to turn it off for all domains.
Click Enable to reactivate it.
Log in to cPanel.
Navigate to Security > ModSecurity.
Scroll to the domain list below.
Under the domain name you want to manage, click On/Off next to “Status”.
That’s it! ModSecurity will now be active/inactive only on the selected domain.
How to Enable or Disable ModSecurity in DirectAdmin
Requirement: The ModSecurity plugin must be enabled on the server by your hosting provider.
Log in to your DirectAdmin panel.
From the user dashboard, go to Account Manager > ModSecurity Setup.
You’ll see a list of your hosted domains with their current ModSecurity status.
To disable ModSecurity:
Toggle the switch to Off for the domain you want.
To re-enable it:
Toggle the switch back to On.
When Should You Temporarily Disable ModSecurity?
Troubleshooting 403 errors or WordPress admin lockouts
Specific plugin conflicts (e.g., contact forms, login security plugins)
During web development or migration, if safe IPs are being blocked
Keep ModSecurity enabled unless you’ve confirmed it’s causing an issue.
If disabling ModSecurity resolves a problem, consider reviewing your app/plugin settings or contacting support to whitelist the triggered rule instead of leaving it off.
Always monitor your site for unusual activity if ModSecurity is disabled.