• 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.

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