To create a sample domain myowntest.domain.com for Client 1 on the basis of Domain template 1, with enabled anonymous FTP, follow these steps:
1. Create an XML packet describing the task, such as the following:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="2.0.1.2">
<add_use_template>
<gen_setup>
<name>myowntest.domain.com</name>
<client_id>1</client_id>
<status>0</status>
<tmpl_id>1</tmpl_id>
</gen_setup>
<hosting>
<vrt_hst>
<ftp_login>ftplog</ftp_login>
<ftp_password>123123</ftp_password>
</vrt_hst>
</hosting>
</add_use_template>
</packet>
In this packet, specify the following variables:
<name> - the full name of the domain to be created (without the http://www prefix)<client id> - the ID number of the client for whom the domain is created in Plesk Expand. <tmpl_id> - the ID number of the domain template on which the domain will be based. <status>0</status> - the domain will have the "enabled" status after creation.<ftp_login> - the FTP login for this domain account.<ftp_password> - the FTP password for this domain account.Note: For the operation to be successful, the domain template must use the Physical hosting hosting type.
2. Save this XML packet in a file - for example, add_domain.xml. The file name format is arbitrary.
3. Direct the file to the standard input (stdin) of the operator exp_plesk_domain used for domain creation.
The query must have the following format:
/usr/local/expand/sbin/exp_plesk_domain <add_domain.xml
Note: exp_plesk_domain is a Plesk Management Operator responsible for domain management operations: creating a new domain, enabling/disabling a domain, setting domain limits, configuring hosting, removing a domain, etc.
For a full list of operators, refer to the Plesk Expand Operators section.
4. The output appears in the shell, in a format similar to the following:
A. Domain was created successfully
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<packet version="1.2.0.27">
<add>
<result>
<status>ok</status>
<id>8</id>
</result>
</add>
<status>ok</status> - operation executed successfully.<id>8</id> - the newly created domain has ID number 8.B. Domain creation failed
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<packet version="2.0.1.2">
<add_use_template>
<result>
<status>error</status>
<errcode>4305</errcode>
<errtext>[Operator] Quota problem. Domains limit was reached for this server.</errtext>
<client_id>11</client_id>
<server_id>2</server_id>
</result>
</add_use_template>
</packet>
Error: domains limit was reached for this server.