- Plesk for Linux
- Apache 2.4 is installed on the server.
It is not possible to create a subdomain using API query, the following error can be found in Plesk:
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/one.example.com/conf/httpd.conf file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php line: 47 code: 0.
This is Plesk bug with ID #PPPM-3924 which is planned to be fixed in future Plesk updates.
As a workaround, execute the API query from a different domain on the server or from a different server.
For Centos 7 Plesk 17.0 the following workaround is acceptable:
1. Make a backup of the existing file
# mv /usr/local/psa/admin/plib/api-rpc/Agent.php /root/
2. Unpack the attached file to the
directory on the server.
With the custom fix installed site during the execution API request via PHP will return 502 error which caused by web server restart on site creation. This is normal behavior for such scenario.