• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

Can't create virtual hosting for domain using API

A

ArturK

Guest
Hi there.

This page:

https://mirror.proserve.nl/plesk/Plesk/PPP9/Doc/en-US/plesk-9.2-api-rpc/index.htm?fileName=33895.htm

shows an example for creating new domain with virtual hosting for an existing user:

<packet version="1.6.0.0">
<domain>
<add>
<gen_setup>
<name>newdomain.com</name>
<owner-id>1234</owner-id>
<htype>vrt_hst</htype>
<ip_address>192.0.2.123</ip_address>
<status>0</status>
</gen_setup>
<hosting>
<vrt_hst>
<ftp_login>c4u7dwbc2y8</ftp_login>
<ftp_password>qweqwe</ftp_password>
<ip_address>192.0.2.54</ip_address>
</vrt_hst>
</hosting>
</add>
</domain>
</packet>



My client creates exactly the same request:

<packet version="1.6.0.2">
<domain>
<add>
<gen_setup>
<name>www.pornstar.es</name>
<owner-id>66</owner-id>
<status>0</status>
<ip_address>94.127.185.100</ip_address>
<htype>vrt_hst</htype>
</gen_setup>

<hosting>
<vrt_hst>
<ftp_login>artur</ftp_login>
<ftp_password>artur12345</ftp_password>
<ip_address>94.127.185.100</ip_address>
</vrt_hst>
</hosting>

</add>
</domain>
</packet>


However, I get error : 1014 Invalid request


I have also tried this: (which is done with new version of the api)

<packet version="1.6.0.2">
<domain>
<add>
<gen_setup>
<name>www.pornstar.es</name>
<owner-id>66</owner-id>
<status>0</status>
<ip_address>94.127.185.100</ip_address>
<htype>vrt_hst</htype>
</gen_setup>

<hosting>
<vrt_hst>
<property>
<name>ftp_login</name>
<value>artur</value>
</property>
<property>
<name>ftp_password</name>
<value>artur12345</value>
</property>
</vrt_hst>
</hosting>
</add>
</domain>
</packet>


No luck either. It gives me the same error.

What could possibly be wrong with it???
 
try this - this is the method I have used
it also includes a lot of stuff you arent using in your example, but you can remove what you dont want.

Code:
<packet version="1.6.0.0">
<domain>
<add>
<gen_setup>
	<name>domain-without-www.com</name>
	<owner-id>9999</owner-id>
	<ip_address>10.10.10.10</ip_address>
	<htype>vrt_hst</htype>
</gen_setup>
<hosting>
	<vrt_hst>
		<property>
			<name>ftp_login</name>
			<value>mylogin</value>
		</property>
		<property>
			<name>ftp_login</name>
			<value>mypassword</value>
		</property>
		<property>
			<name>ssl</name>
			<value>false</value>
		</property>	
		<property>
			<name>php</name>
			<value>true</value>
		</property>
		<property>
			<name>ssi</name>
			<value>true</value>
		</property>
		<property>
			<name>cgi</name>
			<value>true</value>
		</property>
		<property>
			<name>mod_perl</name>
			<value>true</value>
		</property>
		<property>
			<name>mod_python</name>
			<value>true</value>
		</property>
		<property>
			<name>asp</name>
			<value>true</value>
		</property>
		<property>
			<name>ip_address</name>
			<value>10.10.10.10</value>
		</property>
		<shell-forbidden/>
	</vrt_hst>
</hosting>
<prefs>
	<www>false</www>
	<stat_ttl>3</stat_ttl>
</prefs>
<performance>
	<bandwidth>307200</bandwidth>
	<max_connections>100</max_connections>
</performance>
</add>
</domain>
</packet>
 
Last edited:
Thanks

Thanks for the answer. I managed to sort this out just after posting this message by trying various combinations.

I have wasted a lot of time thanks to the Plesk API Reference which is a bit messy for the newcomer.

As a reference I used:
http://download1.parallels.com/Plesk/PPP9/Doc/en-US/plesk-9.5-api-rpc/


It has two examples:

<packet version="1.6.0.1">
<domain>
<add>
<gen_setup>
<name>sample.com</name>
<ip_address>192.0.2.48</ip_address>
</gen_setup>
<hosting>
<vrt_hst>
<property>
<name>ftp_login</name>
<value>ftp16se4fdf0</value>
</property>
<property>
<name>ftp_password</name>
<value>qweqwe</value>
</property>
<ip_address>192.0.2.48</ip_address>
</vrt_hst>
</hosting>
</add>
</domain>
</packet>


OR


<packet version="1.6.0.0">
<domain>
<add>
<gen_setup>
<name>newdomain.com</name>
<owner-id>1234</owner-id>
<htype>vrt_hst</htype>
<ip_address>192.0.2.123</ip_address>
<status>0</status>
</gen_setup>
<hosting>
<vrt_hst>
<ftp_login>c4u7dwbc2y8</ftp_login>
<ftp_password>qweqwe</ftp_password>
<ip_address>192.0.2.54</ip_address>
</vrt_hst>
</hosting>
</add>
</domain>
</packet>

The first one doesn't mention owner-id node
The second one simply doesn't work.
And the mix of two does.
 
Yeah I have found the parallels documentation to be quite bad, especially when it comes to code samples. It has gotten better over the years but obviously its not perfect by any means, no documenation ever really is.

The best part is the engrish, you kind of shake your head reading these things sometimes wondering if their primary audience is really english speaking people, then why they didnt do a better job of translating :)
 
Back
Top