latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

ModSecurity
Rule Settings

Enable all staged ModSecurity rule changes

This function deploys the staged changes for all of the ModSecurity™ configuration files into the live configuration files. After the function deploys the configuration files, it restarts Apache. If the new configuration is invalid, the system restores the original configuration and preserves the staged changes.

Important:

When you disable the Web Server role, the system disables this function.

get/modsec_deploy_all_rule_changes

Response

HTTP Request was successful.

Example response

{
  "data": {
    "failed": [
      "modsec_vendor_configs/MyVendor/one.conf"
    ],
    "outcomes": [
      {
        "config": "modsec_vendor_configs/MyVendor/one.conf",
        "exception": "The system could not deploy changes for modsec_vendor_configs/MyVendor/one.conf: The system could not validate the new Apache configuration, because httpd exited with a nonzero value. Apache produced the following error: httpd: Syntax error on line 37 of /usr/local/apache/conf/httpd.conf: Syntax error on line 26 of /usr/local/apache/conf/modsec2.conf: Syntax error on line 27 of /usr/local/apache/conf/modsec2.cpanel.conf: Could not open configuration file /usr/local/apache/conf/modsec_vendor_configs/MyVendor/one.conf: No such file or directory\n\n\n"
      }
    ]
  },
  "metadata": {
    "command": "modsec_deploy_all_rule_changes",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}