To create a custom virtual host template, create a directory on your local file system, and then create one or more of the following directories inside it:

  • cgi-bin if you want to include custom scripts in the template.
  • httpdocs if you want to include custom documents such as web pages or images.
  • error_docs if you want to include custom error messages.
  • webspace if you want to include custom files to be placed in the subscription home directory (for example, .bashrc, .vimrc, and so on).

After the directories are created, place the files you want to see included in the newly created domains’ virtual host structure in the corresponding directories. You can use the default files stored in the /var/www/vhosts/.skel/0 on Linux or C:\inetpub\vhosts\.skel\0 on Windows if you wish.

Additionally, you can use variables in the custom virtual host template. The variables will be substituted with the corresponding values after the domain creation:

  • @domain_name@ - This variable is substituted with the domain name. Used on Linux and Windows.
  • @client_email@ - This variable is substituted with the customer’s email address. Used on Windows only.

Once you have added all the files you wanted, pack the directories in a tgz, tar, tar.gz, or a zip archive. Make sure that the directories are in the root of the archive file and not in a subdirectory. If you include other directories or files in the root of the archive, Plesk will not add them to the template.

To upload the custom virtual host template, go to Tools & Settings > Virtual Host Template (in the Tools & Resources group), click Browse, locate the prepared archive file, and then click Send File. To revert to the default virtual host template, click Default.