• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved xml api set Additional directives for HTTP in Apache & nginx Settings

christian

Basic Pleskian
hello.
to completely automatise process, i used plesk xml api to create Customer, domain and subscription.
it work perfectly,
but now, i'm searching how to set Additional directives for HTTP in Apache & nginx Settings with the xml plesk api.
i'm already tried by adding file diretly, (by php script) but it need root rights to be effective. security hole.
don't find a way in plesk documentation to to this with plesk xml api
please help.
 
i'm encountered problem with nginx subcription with xml api.
the customer need to execute call to api from the server himself.
but the problem is not in the call himself or parameters, but in the fact that nginx reset himself to apply change and broke process. the sender always get an "502 bat gateway" returned from nginx. how i can manage this.?
can i program delayed nginx reset to terminate script call sucesfully before?.
please help
 
Hello @christian,
now, i'm searching how to set Additional directives for HTTP in Apache & nginx Settings with the xml plesk api.
.

Yes we have a bug (feature request) about it. Id is PPP-26956. It will be implemented in a future releases.

the customer need to execute call to api from the server himself.
but the problem is not in the call himself or parameters, but in the fact that nginx reset himself to apply change and broke process. the sender always get an "502 bat gateway" returned from nginx. how i can manage this.?
can i program delayed nginx reset to terminate script call sucesfully before?.
please help

We have a similar issue but for Apache server. And the problem is in PHP interpreter mostly, not really in server reload. The case (execute Plesk API queries via subscription's interpreter) is rare, so priority of this issue is low. Please, provide a details:
- what php interpreter assigned to subscription?
- what API request failed?
 
the problem occur when i send the command to create webspace from 127.0.0.1 on plesk server from php script
i use xml api to set operation in this order:
1 :
<packet>
<customer>
<add>
<gen_info>
....
</gen_info>
</add>
</customer>
</packet>
proceed normally and return result if i stop script here.

2: generated from php script
"<packet>
<webspace>
<add>
<gen_setup>
<name>".$customer->website."</name>
<owner-id>".$customer->id."</owner-id>
<htype>vrt_hst</htype>
<ip_address>".$customer->ip."</ip_address>
<status>0</status>
</gen_setup>
<hosting>
<vrt_hst>
<property>
<name>ftp_login</name>
<value>".$customer->ftp_login."</value>
</property>
<property>
<name>ftp_password</name>
<value>".$customer->ftp_passwd."</value>
</property>
<ip_address>".$customer->ip."</ip_address>
</vrt_hst>
</hosting>
</add>
</webspace>
</packet>
";
this is where the probleme append. after the call to create webspace, the navigator receive 502 bad gateway nginx..but the script still running, and webspace is created.
and all other operations are done by the script, normally.
so, it's still remain a problem. when you launch a command, from command line or navigator session, it's legitimate to expect that the server don't broke connection as it want..and receive at last returned error msg or anything wich make sense to the request..

the problem occur only when i call the script from http call by navigator..
when i launch the script from command line, as root, or user, like
/usr/bin/php script.php it run normaly and return results as expected.


php on domain calling xml api : PHP_VERSION 5.5.9-1ubuntu4.21 fastcgi served by apache.
i use PleskApiClient.php unmodified to call the api.
if you want to test, or investigate, i can set you open bar to my test server..
 
Last edited:
hello, i resolved the problem by bypassing the problem, calling xml api from external server and finalising from plesk server runnable.
but, i can't figure how to set à little parameter.
i need to set the locale language for user, with plesk, but can't find it in xml api.
in plesk admin panel, it's in Home->Subscriptions->subscription_name->Users->User_Accounts->create User Account or change setting user account
we can set locale with interface, but can't find how to set locale with xml .
i use xml formed like this with php
<packet>
<user>
<add>
<gen-info>
<login>".$account_emails."</login>
<passwd>".$password_emails."</passwd>
<owner-guid>".$customer->guid."</owner-guid>
<name>".$customer->website."_emails</name>
</gen-info>
<roles>
<name>".$customer->email_rolename."</name>
</roles>
</add>
</user>
</packet>

now, the question is, can i set locale value? where to set or how to set in this request.?
 
Back
Top