• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Create Subdomain on different home with RCP API

J

jebbie23

Guest
Hello out there,

i am using Plesk RCP API with a PHP Project and basically it works fine. I need to create several subdomains on my server through the RCP API and there is a huge issue in my eyes:

<packet version="1.5.2.0">
<subdomain>
<add>
<parent>maindomain.com</parent>
<name>test</name>
<home>/httpdocs</home>
<property>
<name>php</name>
<value>true</value>
</property>
</add>
</subdomain>
</packet>

It's like the documentation says in the examples ("Creating a subdomain on subfolder"):
http://download1.parallels.com/Plesk/Plesk8.3/Doc/en-US/plesk-8.3-api-rpc/53497.htm

So, it should work! At least that's what i think...

So, i currently don't really know where is the "start-point" of this "home"-parameter... So i tried some variants of the "home-path"... but on any value i choose, it's happening always the same stuff:

the response says status=ok, the creation of the subdomain works and it points always to the same directory:

/var/www/vhosts/maindomain.com/subdomain/test/httpdocs

Thats not nice! Because the documentation is saying clearly that it must be possible!

When i go to the config file "httpd.include" of my "maindomain.com", i see that the subdomain is created completely wrong, just ingoring the whole "home-parameter" of my api call..

and when i change there the directory directly in the "httpd.include" file, and restart the server.. the subdomain is working like a charm, pointing directly to the folder of the maindomain.com -.-


Why this odd behavior? What am i making wrong? I have searched the whole web about this issue, and all i find are some other threads, asking exactly the same (but not written with so much information, so i decided to create a new thread) -> but there is never an answer about that...
 
Ok funny.. i have found the solution by myself.

It was the Plesk Version... sorry i'm still verry new in Plesk and.. yea.. later on the evening yesterday, i found the command-line tool "subdomain" inside of psa/bin

In the manual of this tool, there was missing an option "--www-root".. so i thought, maybe my plesk version just can't handle the change of the home-directory... So i made an update from Plesk 9 to 10 and hurray, its working now from the API!
 
Back
Top