• 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.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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