• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

problem with apache configuration when adding a domain with xml api

Richard Markink

New Pleskian
Getting a error when trying to add a domain using the plesk xml api.

error:
New configuration files for the Apache web server were not created due to the errors in configuration templates: Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = Template_Exception: Empty content was provided for config file /var/www/vhosts/system/elearning.richardmarkink.nl/conf/httpd.conf file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php line: 47 code: 0. Detailed error descriptions were sent to you by email. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files.

the website is added but there are no apache config files.

the xml code is used:
<packet>
<site>
<add>
<gen_setup>
<name>elearning.richardmarkink.nl</name>
<webspace-id>4</webspace-id>
</gen_setup>
<hosting>
<vrt_hst>
<property>
<name>fp</name>
<value>false</value>
</property>
<property>
<name>fp_auth</name>
<value>false</value>
</property>
<property>
<name>fp_admin_login</name>
<value/>
</property>
<property>
<name>fp_admin_password</name>
<value/>
</property>
<property>
<name>www_root</name>
<value>/elearning.coursenet.nl</value>
</property>
</vrt_hst>
</hosting>
</add>
</site>
</packet>

can someone give me a solution for this ? or what am i doing wrong ?
using plesk 12.5 on centos
 
I have tried your XML code on my test Plesk 12.5 server and added this domain without any problems:

POST https://ppu12-5.demo.pp.plesk.ru:8443/enterprise/control/agent.php

Request headers:
HTTP_AUTH_LOGIN: admin
HTTP_PRETTY_PRINT: TRUE
HTTP_VALIDATE_RESPONSE: TRUE
HTTP_AUTH_PASSWD: setup

Request body:
<packet>
<site>
<add>
<gen_setup>
<name>elearning.richardmarkink.nl</name>
<webspace-id>1</webspace-id>
</gen_setup>
<hosting>
<vrt_hst>
<property>
<name>fp</name>
<value>false</value>
</property>
<property>
<name>fp_auth</name>
<value>false</value>
</property>
<property>
<name>fp_admin_login</name>
<value/>
</property>
<property>
<name>fp_admin_password</name>
<value/>
</property>
<property>
<name>www_root</name>
<value>/elearning.coursenet.nl</value>
</property>
</vrt_hst>
</hosting>
</add>
</site>
</packet>

Response status code: 200

Additional headers:

Response body:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
<site>
<add>
<result>
<status>ok</status>
<id>4</id>
<guid>233c4543-6b0b-4afc-83f1-b9207eb6967e</guid>
</result>
</add>
</site>
</packet>

(changed only webspace-id to 1 because I have no with id 4).
Maybe you have initial config issues before adding this domain? Try to repair webserver settings with

# plesk repair web

and run this API request again.
 
tested some things today:

When I use a web plugin to send curl post request to my server there is no problem and it is working fine, but when i use the php API client as find on the github the error occeur and a 503 page is shown.
what can be the problem?
 
Back
Top