• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Resolved Plesk XML API

Deepak Sharma

New Pleskian
Hi,

I am using Plesk XML API to automate Virtual Directory creation for a subdomain xyz.mydomain.com and request packet structure is as below.

<?xml version="1.0" encoding="utf-8" ?>
<packet>
<virtdir>
<create>
<site-id>27</site-id>
<name>/vd1</name>
<properties/>
</create>
</virtdir>
</packet>

I am getting error which error code is 1015 and error description says "Virtual host does not exist"

xyz.mydomain.com has dedicated IP assigned.

I tried with adding an entry in \etc\hosts file that map the IP address to above host name. No luck.

Any help is much appreciated.
 
Error message 1015 means - Parent site/subdomain is not found.
Are you sure that site-id=27 is correct?
 
I am assuming this is ID that we found from this location
IIS >> Advanced Settings of site >> ID property under General section
 
You can find correct site-id in Plesk database with following SQL query:

mysql> select id from domains where name='xyz.mydomain.com';
 
Thanks for your help.

There is an option to create a new database in Plesk but that is specific to site under which we are creating and its completely blank. No default structure or table in it.
Doesn't Plesk maintain a common database that used to store information from all domains?
 
IgorG,

Finally, I got a way to obtain Information about all sites using request packet as below

<packet>
<webspace>
<get>
<filter/>
<dataset>
<hosting/>
</dataset>
</get>
</webspace>
</packet>

This gives me Pesk's Site ID for each Primary domain. For non-primary domain, need to replace <webspace> with <site>

Thanks a lot for your help and suggestion.
 
Back
Top