• 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

Resolved XML API php : Assign a existing certificate to a subdomain.

RARJ

New Pleskian
Hi,
I create subdomain with the XML API on php language. The subdomain is created succefully and the SSL certificate is actived. I have 3 certificate in the server, but I dont know how I assign one of this to the subdomain in the request Packet.
Here is the packet :

<packet>
<subdomain>
<add>
<parent>domain.name</parent>
<name>$alias</name>
<property>
<name>www_root</name>
<value>httpdocs/$alias/</value>
</property>
<property>
<name>ssl</name>
<value>true</value>
</property>
<property>
<name>same_ssl</name>
<value>true</value>
</property>
<property>
<name>fastcgi</name>
<value>true</value>
</property>
<property>
<name>ssi</name>
<value>true</value>
</property>
<property>
<name>php</name>
<value>true</value>
</property>
<property>
<name>php_handler_id</name>
<value>plesk-php56-fastcgi</value>
</property>
</add>
</subdomain>
</packet>

Thank you for help me.
 

Attachments

  • plesk.jpg
    plesk.jpg
    18.3 KB · Views: 10
You need to use <site> operator with <parent-site-id>1</parent-site-id> instead of <subdomain> https://docs.plesk.com/en-US/onyx/a...g-sites-domains/creating-a-site.66574/#o66579

Here is example:

<packet>
<site>
<add>
<gen_setup>
<name>sub555.example.com</name>
<webspace-id>12</webspace-id>
<parent-site-id>1</parent-site-id>
</gen_setup>
<hosting>
<vrt_hst>
<property>
<name>ssl</name>
<value>true</value>
</property>
<property>
<name>certificate_name</name>
<value>Lets Encrypt example.com</value>
</property>
</vrt_hst>
</hosting>
</add>
</site>
</packet>
 
Back
Top