Add ModSecurity configuration file include

This function adds an include for a ModSecurity™ configuration file to the modsec2.cpanel.conf file. This makes the ModSecurity configuration file active.

Important:

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

SecurityBasicAuth
Request
query Parameters
config
required
string

The ModSecurity configuration file's path and filename, relative to the /usr/local/apache/conf/ diretory.

Example: config=modsec_vendor_configs/example.conf
Responses
200

HTTP Request was successful.

Response Schema: application/json
data
object
object
get/modsec_make_config_active
Request samples
whmapi1 --output=jsonpretty \
  modsec_make_config_active \
  config='modsec_vendor_configs/example.conf'
Response samples
application/json
{
  • "data": { },
  • "metadata": {
    • "command": "modsec_make_config_active",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}