The structure of website directories
As soon as someone creates a Web site, Plesk not only adds a virtual host to the Web server, but also creates the directory structure for the Web site and populates the directories with some initial content. These directories are located in the appropriate virtual host directories:
- Under Linux:
/ Var / www / vhosts /
- Under Windows:
C: \ inetpub \ vhosts \
If you want to change the files and directories contained in new websites (eg add scripts or change the error pages), you can create your own Template for virtual hosts define. Resellers can also customize the virtual host templates for their customers.
Note: Subdomains have the same status as domains and use the same directory structure. Therefore, they have a separate directory in
/ Var / www / vhosts and their own configuration files, such as
Configure a custom virtual host template
To create a custom virtual host template, you must create a directory on your local file system and then create one or more of the following directories in it:
cgi-binif you want to integrate custom scripts into the template.
httpdocsif you want to integrate custom documents such as webpages or images.
error_docsif you want to integrate custom error messages.
webspaceif you want to include custom files to store in the subscription's home directory (for example, .bashrc, .vimrc).
After the directories have been created, you must now place the files that you want to have integrated in the virtual host structure of the newly created domains in the appropriate directories. If you want, you can use the default files that are under Linux in the directory
/var/www/vhosts/.skel/0 or under Windows in the directory
C: \ inetpub \ vhosts \ .skel \ 0 are stored.
You can also use variables in the custom virtual host template. The variables are replaced with the corresponding values after creating the domain:
- @ @ Domain_name: This variable is replaced by the domain name. Used on Linux and Windows.
- @ @ Client_email: This variable is replaced by the customer's e-mail address. Only used on Windows.
Once you've added all the files you want, pack the directories into a tgz, tar, tar.gz or zip archive. Make sure 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.
Now if you want to upload the custom template for virtual hosts, go to Tools & Settings > Template for virtual hosts (in the group Tools & Resources), Click on Search, search for the prepared archive file and then click send file, You can reset the settings back to the default template for virtual hosts by clicking default click.