Jump to content
  • 0

Provisioning Plesk Accounts On Same Server As Blesta Is Not Possible


Question

Posted

Not sure if this is a supported configuration, but for testing purposes I'm trying to provision a Plesk webhosting account on the same Plesk server Blesta is running on.

Problem is that Plesk has the nasty habit of restarting Apache every time a new website is added to the system.

So when I activate a new Plesk order through the Blesta admin interface with "use module" checked, this causes Plesk to restart Apache, and this kills all connections and the running Blesta PHP process.

[Sat Apr 26 22:22:06 2014] [notice] caught SIGTERM, shutting down
[Sat Apr 26 22:22:15 2014] [error] FastCGI process 14718 still did not exit, terminating forcefully

Receive an error in my browser ("502 Bad gateway" returned by the nginx reverse proxy in front of Apache, indicating connection to Apache was lost)

And that Plesk succeeded adding the website is not registered in Blesta, module log shows webspace:add was last API command sent, and no reply registered.

 

Not sure if Plesk is the only hosting panel affected by this, or others may have the same problem as well.

May be better to postpone the creation of new hosting accounts until next cron run, and provision them from there.

10 answers to this question

Recommended Posts

  • 0
Posted

Unfortunately, there's no workaround. Plesk is killing Blesta while it's in the middle of performing a task. If you could configure plesk not to restart apache, or if you ran blesta under a different web server (nginx/lighttpd/etc.) or entirely separate server you probably wouldn't have any problems.

  • 0
Posted

Another ugly workaround may be for Blesta not to wait for the response from Plesk (which doesn't come until after Apache has been restarted)

There are 9 seconds between the moment Apache is asked to terminate nicely, and it forcible kills the PHP FastCGI process.

So it does have time to simply mark the service active, if no negative response is received within a second or so.

 

Only problem is that it then is not able to store the newly created webspace id returned by Plesk.

But think that can be retrieved by domain name later on.

  • 0
Posted

Another thought: you could allow cron to provision as it runs outside of apache and so should not be affected.

 

Yeah, marking the invoice paid, and let cron deal with it does create it ok.

Just a bit annoying. Not only occurs on creation, but also on other admin actions like suspend/delete.

  • 0
Posted

Thanks.

 

 

Tried setting the restart interval to 300.

That seems to work sufficiently for my testing purposes, but be aware that it is not a solution one could recommend to other customers wanting to put this in production.

 

It seems that Plesk doesn't treat a "Apache restart interval" of 300 as "restart Apache 5 minutes after a change" but as "restart Apache at most every 5 minutes"

 

  •  First request from Blesta to Plesk still sends SIGTERM to Apache instantly
  •  If you have an ongoing stream of subsequent requests those are all handled fine.
  •  If you do nothing for 10 minutes, the next request from Blesta to Plesk will send SIGTERM instantly again.
  • 0
Posted

Hello,

 

I would like to know if with the recent version of Blesta and Plesk 12 this problem is still happening when blesta is installed on the same server than plesk. May be it's a bug for only old version as the post is old. 

 

Regards,

  • 0
Posted

Hi Nelsa,

 

I recently posted a solution for this issue a few days back in the Contribute section, maybe you missed it. And it is exactly the solution you finally got to. Check this:

 

http://www.blesta.com/forums/index.php?/topic/6246-plesk-issues-with-apache-restarts/

 

I am wondering how still most people haven't got to grips with this issue as yet, as the solution is already documented on the official Plesk site...maybe the Plesk KB need to update their article titles to be more specific to the issue rather than just "How to enable Apache graceful restart in Plesk".

 

Thanks.

  • 0
Posted

I second what you say about keeping the main site along with billing/support seperate from the Provisioning Server(Plesk/cPanel/Proxmox) and is the most ideal setup. But, it would also mean having the added burden of managing & maintaining multiple servers in the setup.

 

Also, small/budget businesses often have only limited resources at their disposal so, it makes sense to have everything bundled within one server which makes it easier for them to maintain just that one server.

 

The option to have both Plesk & Blesta(or any other billing) on the same box would appeal to those with limited resources or for those having a limited number of Plesk clients. And the solution to restart apache gracefully should work smoothly & efficiently even under heavy workload, provided your server is capable of handling such tasks.

 

I do not know how the Nginx solution would resolve the issue and I would be interested with your test results.

 

Thanks.

  • 0
Posted

Thanks for the results.

 

I think the "Apache with graceful restarts" would be a safe bet rather than the nginx one. It is much more straight forward and does not need additional extensions to get the job done.

 

By the way you should not be surprised to see Nginx restarting, since Plesk would restart the web server(Apache/Nginx) by default for any changes made according to the "Apache restart interval" setting.

 

The guys at Plesk should rather update the default behaviour of Plesk to rather restart Apache gracefully and just get done with the issue. I am not sure what is actually holding them back from such a change.

 

Thanks.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...