We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.
We will continue to maintain our API documentation on this server.
We strongly recommend that you use include files to modify the content of an individual virtual host. For more information on how to use include files, read our Modify Virtualhost Containers With Include Files documentation.
cPanel & WHM stores information about domains in the subdirectores in the
/var/cpanel/userdata/ directory. cPanel & WHM then uses that data to build the virtual hosts for your Apache configuration.
Use the include files that allow you to modify an individual virtual host configuration. Alternatively, you can use a custom template that modifies the data in the
/var/cpanel/userdata/ directory for an individual domain.
The subdirectories within the
/var/cpanel/userdata/ directory contain YAML files. For more information about the YAML format, visit the official YAML website.
Do not manually edit these YAML files.
EasyApache loads these files into the
vhost template variable. For more information about the
vhost variable and Template Toolkit, visit the Template Toolkit website.
To create a custom template that affects how cPanel & WHM builds entries for only a single virtual host, perform the following steps:
vhost.local— Use this filename if you copied the
ssl_vhost.local— Use this filename if you copied the
Move the new file to any other directory.
You may move this file to any directory because you will specify the location of the file in the next step.
Use the following script to add the necessary information to the data structure: