latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

ModSecurity
Server Settings

Add ModSecurity configuration file text

This function adds text to a ModSecurity™ configuration file.

Important:

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

get/modsec_assemble_config_text

Query parameters

configstring required
Example:modsec_vendor_configs/example.conf

The ModSecurity™ configuration filename and file path, relative to the /etc/apache2/conf/ directory.

deploy1 | 0
Example:1

Whether to deploy the new text to the system.

  • 1 — Deploy.
  • 0 — Do not deploy.
final1 | 0
Example:1

Whether to add the text as the final upload to the configuration file.

  • 1 — Final upload.
  • 0Not the final upload.

Note:

  • You must use this parameter if you wish to add the text as the final change to the configuration file.
  • You must use the init parameter with this parameter if you wish to only make one change to the configuration file.
init1 | 0
Example:1

Whether to add the text as the initial upload to the configuration file.

  • 1 — Initial upload.
  • 0Not the initial upload.

Note:

  • You must use this parameter if you wish to add the text as the initial change to the configuration file.
  • You must use the final parameter with this parameter if you wish to only make one change to the configuration file.
textstring
Example:newtext

The text to add to the configuration file.

Response

HTTP Request was successful.

Example response

{
  "metadata": {
    "command": "modsec_assemble_config_text",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}