To host different objects, particularly, domains, subdomains and web users, which we call hosted objects, Parallels Plesk Panel performs in Windows the following two operations for every object:
%plesk_vhosts%E.g., for a domain with physical hosting, the root directory is %plesk_vhosts%\<domain name> containing folders and files defined by a virtual host template (default are /anon-ftp, /error-docs, /httpdocs, etc.)
E.g., for a domain with physical hosting three Windows users are created: Parallels Plesk Panel Domain User (<COMPUTER-NAME>/<FTP/Microsoft FrontPage Login>), Parallels Plesk Panel IIS User (<COMPUTER-NAME>/<IUSR_FTP/Microsoft FrontPage Login>) and ftp_subaccounts (<COMPUTER-NAME>\ftp_subaccounts)
For proper functioning of the Parallels Plesk Panel hosted objects, such Windows users must have particular permissions on accessing objects' folders and files. This is provided using security metadata files based on security templates the following way: Each hosted object in Parallels Plesk Panel is accompanied with a specific security metadata describing what users should have which access to which file or folder of this hosted object. Parallels Plesk Panel creates a particular object security metadata basing on a security template file which contains pattern entries describing access rights.
Parallels Plesk Panel provides the following default security templates, all located in %plesk_dir%\etc\:
hosting_template.xml - pattern security entries for domains with physical hostingframe_forwarding_template.xml - domains with frame forwardingsubdomain_template.xml - subdomainswebuser_template.xml - web usershosting_write_template.xml, subdomain_write_template.xml, webuser_write_template.xml - additional set of pattern entries used when the Additional write/modify permissions option is enabled on domains with physical hosting, subdomains, or web users, correspondinglyThe number of security templates can be extended as desired, what is important is that they must be of a proper format.
When a hosted object is created in Parallels Plesk Panel, Parallels Plesk Panel creates in Windows folders, files and users of the hosted object, then calls the HostingSecurity.exe utility which a) creates the object's security file - an XML file .Security in the object's root folder, b) writes to this file the object's security metadata - security rules from the required default template (listed above) using this object's users, c) applies these rules to Windows security settings of the object's folders and files.
The HostingSecurity.exe utility serves to manage Parallels Plesk Panel hosted objects security templates and security metadata together with Windows security settings. The utility allows performing the following operations:
Location
%plesk_bin%
Usage
HostingSecurity.exe <command> [
<option1>=<param1>[
<option2>=<param2>[
<option3>=<param3>]]
]
Example
The following command removes access entries specified in the custom template ftp-subaccounts.xml located at %plesk_dir%\etc\ from security metadata and settings of photo.example.com:
>HostingSecurity.exe --update-subdomain-security --vhost-name=example.com --subdomain=photo --remove-template=%plesk_dir%\ftp-subaccounts.xml
Commands
Command |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Creates a default domain security template. Unless file location and name are specified with the |
To restore missing default domain security template >HostingSecurity.exe --create-domain-template --file-name="%plesk_dir%\etc\hosting_template.xml" |
|
|
Creates a default frame forwarding domain security template. Unless file location and name are specified with the |
To create a default frame forwarding domain security template with default name in the current location: >HostingSecurity.exe --create-frame-forwarding-template |
|
|
Creates a default subdomain security template. Unless file location and name are specified with the |
To restore missing default subdomain security template >HostingSecurity.exe --create-subdomain-template --file-name="%plesk_dir%\etc\subdomain_template.xml" |
|
|
Creates a default web user's security template. Unless file location and name are specified with the |
To create a default web user security template under the name >HostingSecurity.exe --create-webuser-template --file-name=D:\temp\web-user-template.xml |
|
|
Creates domain security metadata from a template. Requires If the |
To create a security metadata file for the domain example.com basing it on the template >HostingSecurity.exe --create-domain-security --vhost-name=example.com --file-name=D:\security-templates\hosting_template3.xml |
|
|
Creates frame forwarding domain's security metadata from a template. Requires If the |
To create a security metadata file for the frame forwarding domain sample.net basing it on the default template >HostingSecurity.exe --create-frame-forwarding-security --vhost-name=sample.net |
|
|
Creates subdomain security metadata from a template. Requires If the |
To create security metadata file for the subdomain blog.example.com basing it on a security template >HostingSecurity.exe --create-subdomain-security --vhost-name=example.com --subdomain-name=blog --file-name=D:\security-templates\blog-sub-templ.xml |
|
|
Creates web user's security metadata from a template. Requires If the |
To restore a missing security metadata file for the web user example.com/~Terry basing it on a Parallels Plesk Panel default template >HostingSecurity.exe --create-webuser-security --vhost-name=example.com --web-user=Terry --file-name="%plesk_bin%\webuser-template.xml" |
|
|
Updates domain security metadata by applying or removing templates, and updates Windows security settings of the domain's files and folders. Requires If no template is specified with an option |
To add access entries from the Parallels Plesk Panel template >HostingSecurity.exe --update-domain-security --vhost-name=example.com --add-template="%plesk_dir%\etc\hosting_write_template.xml" |
|
|
Updates subdomain security metadata by applying or removing templates, and updates Windows security settings of the subdomain's files and folders. Requires the If no template is specified with an option |
To remove access entries specified by the custom template >HostingSecurity.exe --update-subdomain-security --vhost-name=example.com --subdomain=photo --remove-template=%plesk_dir%\ftp-subaccounts.xml |
|
|
Updates web user's security metadata by applying or removing templates, and updates Windows security settings of the web user's files and folders. Requires If no template is specified with an option |
To apply Parallels Plesk Panel default security template to security metadata and Windows settings of web user example.com/~MaryJane: >HostingSecurity.exe --update-webuser-security --vhost-name=example.com --web-user=MaryJane |
Options
Option |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Specifies the fully qualified name of a security template (absolute path to the file starting from disk name + file name). |
To create a default web user security template under the name >HostingSecurity.exe --create-webuser-template --file-name="D:\Security Templates\web-user-template.xml" |
|
|
Specifies name of a domain to be affected. Required with all commands except the |
To create a security metadata file for the frame forwarding domain sample.net basing it on the default template >HostingSecurity.exe --create-frame-forwarding-security --vhost-name=sample.net |
|
|
Specifies name of a subdomain to be affected. Required with all the |
To update security metadata and Windows settings of the subdomain blogs.sample.net using Parallels Plesk Panel default subdomain security template: >HostingSecurity.exe --update-subdomain-security --vhost-name=sample.net --subdomain=blogs |
|
|
Specifies name of a web user to be affected. Required with all the |
To restore a missing security metadata file for the web user example.com/~Terry basing it on a Plesk default template : >HostingSecurity.exe --create-webuser-security --vhost-name=example.com --web-user=Terry |
|
|
Specifies a security template containing security rules that should be added to an object's security metadata and applied to Windows security settings of the object's files and folders. Used only with the |
To add additional access entries specified by the custom template >HostingSecurity.exe --update-domain-security --vhost-name=example.com --add-template="%plesk_dir%\Security Templates\extended-ftp-subaccounts.xml" |
|
|
Specifies a security template containing security rules that should be removed from an object's security metadata and from Windows security settings of the object's files and folders. Used only with the |
To remove access entries specified in the template >HostingSecurity.exe --update-domain-security --vhost-name=example.com --remove-template="%plesk_dir%\etc\hosting_write_template.xml" |