Applicable to:
- Plesk for Linux
Symptoms
-
Ubuntu 14.04 with
systemd
or Debian 8 is used. -
The error occurs in Plesk interface:
PLESK_ERROR: Can not reconfigure web server configurations: Unable to execute httpdmng: Execution failed.
Command: httpdmng
Arguments: Array
(
[0] => --reconfigure-domains -
The following error can be found in
/var/log/plesk/panel.log
file:CONFIG_TEXT: ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/apache_control_adapter' '--restart' '--restart-interval' '0' '--http-port' '80' '--https-port' '443'] with exit code [255]Error occured while sending feedback. HTTP code returned: 502
ERR [panel] Apache config (14855280520.33207700) generation failed: Template_Exception: Can not restart web server:
file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php
line: 108
code: 0
Can not restart web server: -
Upgrade to Plesk Onyx was failed. In
/var/log/plesk/install/autoinstaller3.log
following errors can be found:CONFIG_TEXT: Failed to issue method call: Unit apache2.service failed to load: No such file or directory. See system logs and 'systemctl status apache2.service' for details.
/bin/systemctl: invalid option -- 'l'
Failed to issue method call: Unit mysql.service failed to load: No such file or directory. See system logs and 'systemctl status mysql.service' for details.
/bin/systemctl: invalid option -- 'l'
Cause
This is Plesk bug #PPPM-5514 which is planned to be fixed in future product updates.
Resolution
As a workaround, perform the following actions:
-
Connect to the server via SSH.
-
Create a backup of the
/opt/psa/admin/sbin/pleskrc
file:# cp -p /opt/psa/admin/sbin/pleskrc /opt/psa/admin/sbin/pleskrc.back
-
Replace
"systemctl"
with"systemctl_pp"
in the/opt/psa/admin/sbin/pleskrc
file:# sed -i 's/systemctl/systemctl_pp/g' /opt/psa/admin/sbin/pleskrc
Comments
31 comments
That did it for me, thanks.
After performing dist-upgrade on my server running Ubuntu 14.04.5 (Plesk Onyx v17.5.3_build1705170317.16 os_Ubuntu 14.04).
I have similar issue on Centos...
Hello @tomaz, could you, please, let me know the exact error message you get?
This should help to suggest you a solution.
This bug is registered as specific for Ubuntu 14.04 with
systemd
or Debian 8.Similar problem here on Centos, after plesk update itself on Aug/06:
"Can not restart web server: INFO: [Mon Aug 6 12:52:11 -03 2018]: Service: httpd, Action: stop Trying to stop service httpd... WARNING! Some problems are found during attempt to status service pc-remote - control script doesn't exist or isn't executable(see log file: /var/log/plesk/rc_actions.log) Continue... STOP ...." (very long text)
Hi,
I updated fist my ubuntu server from version 14.04 to 16.04. After that I used the installer to upgrade plesk from version 12.5 to Plesk Onyx 17.8.11 Update #16.
Plesk can't start the apache2 service anymore through apache_control_adapter. There is also a Template Exception but I have no clue where to Search.
httpdmng --reconfigure-domains fails due to the following exception:
Details: [2018-08-08 14:14:09.606] ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/apache_control_adapter' '--restart' '--restart-interval' '0' '--http-port' '80' '--https-port' '443'] with exit code [255]
[2018-08-08 14:14:11.739] ERR [panel] Apache config (15337302900.32783500) generation failed: Template_Exception: Can not restart web server:
file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php
line: 109
code: 0
Can not restart web server:
Starting or restarting the server with service apache2 start works.
Thanks you,
Peter
Hi @Jorge!
The resolution in this article is specific for dist-upgrade issues, so the cause of the error that you faced should be different. As the issue occurs after the update, I suggest re-applying the updates:
# plesk installer update --repatch
And then executing the following command:
# plesk repair installation
In case it will not help, then submit a full request to technical support.
Hi @Peter Peterson!
Could you provide me with the content of /opt/psa/admin/sbin/pleskrc? Also, execute the following command in order to re-read server components and try restart via apache_control_adapter again:
# plesk sbin packagemng -sdf
Hi @Alexandr Shadrin,
the plesk sbin packagemng -sdf didnt help. the content of the desired folder is: https://pastebin.com/jmjDHzcf
Thank you,
Peter
Hi @Alexandr Shadrin
Thank you so much, it worked!
Hi again, @Peter Peterson!
Script looks fine (in case systemd is used), so I suggest troubleshooting the issue further in the following manner:
1. Try restarting apache with various methods, for example:
# service apache2 restart
# systemctl restart apache2
# /etc/init.d/apache2 restart
# /usr/sbin/invoke-rc.d apache2 restart
Maybe some of them will finish in 0 seconds, then the cause will be the fact that service is disabled. Maybe you will need to run the following command in order to make apache_control_adapter work:
# update-rc.d mysql enable
Hi @Jorge!
Glad I can help!
Hello, I have a similar problem on my VPS.
plesk shows the error "The new configuration files for the Apache web server were not created due to errors in the configuration templates"
I followed what was written before, but I did not solve anything. Another error is shown to me when I run the command via ssh: "plesk repair web -server" which fails with the error: "Template_Exception: Can not restart web server:
file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php
line: 109
code: 0
"
Ultimately, the apache web server does not boot in any way.
Can someone help me please? I do not know what to do...
Hi @Eros Bruno !
If dist-upgrade takes place, ensure that it is fully completed. Also, check if Apache service is enabled for starting on system startup (you can use this article for reference).
If the issue is not resolved after that, consider searching for the similar articles in our Help Center (as this one covers pretty edge case - bug on specific OSs) or submitting a support request.
@Eros Bruno I was having your exact same issue. In the end, I followed this article, which lead me here. This step is important as well, otherwise you might lose your config at the next reboot+reconfig.
This would have saved me hours of investigating. Hope it helps.
I have exactly the same problem
Unable to generate Apache configuration files: Template_Exception: Can not restart web server
Debian 8.11
Plesk Onyx
Version 17.8.11
i rent the commands:
# plesk installer update --repatch
# plesk repair installation
But the problem can't be resolved
Errors occurred while performing the following actions: restore mail, fix Apache configuration, regenerate web servers configuration files.
Check '/var/log/plesk/install/plesk_17.8.11_repair.log' and '/var/log/plesk/install/plesk_17.8.11_repair_problems.log' for details.
If you can't resolve the issue on your own, please address Plesk support.
Hello @Badreddine,
For such cases, a deeper investigation is required.
Please, submit a request to one of our partners, from which you purchased the Plesk key or submit a request to Plesk Technical Support using this article:
https://support.plesk.com/hc/en-us/articles/213953025-How-to-get-support-directly-from-Plesk-
Hi all, I have my Apache that can't start again since a made the plesk upgrade.
Debian 8.11 + Plesk Onyx 17.8.11
Error: Can not reconfigure web server configurations: Unable to execute httpdmng: [2019-01-10 09:20:28.975] ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/apache_control_adapter' '--restart' '--restart-interval' '0' '--http-port' '7080' '--https-port' '7081'] with exit code [255]
[2019-01-10 09:20:29.708] ERR [panel] Apache config (15471082990.71891500) generation failed: Template_Exception: Can not restart web server:
file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php
line: 109
code: 0
I tried this procedure but the conf fil is rewrited at server restart and I come back to the same situation
Code:
nano /etc/hosts
then add the ip of the site
example 1.1.1.1 stock.ovh (for my part at the end it's stock.ovh)
@David Combarieu
Hi! Just tried the resolution on my test machine, and /opt/psa/admin/sbin/pleskrc was not recreated after the restart. Have you used the same command as in the article?
Please also try "/opt/psa/admin/bin/httpdmng --reconfigure-all" as well. If this won't help, please submit a request to support as per https://support.plesk.com/hc/en-us/articles/213608509
@alisa
I just tried the following :
[code]
plesk repair web
[/code]
and this worked for me.
@David Combarieu
The "plesk repair web" and the "/opt/psa/admin/bin/httpdmng --reconfigure-all" are basically the same :) Glad to know that it helped!
Hello,
I have the very exact same issue as David as I have a VPS @OVH and I'm having the same error code:
Can not restart web server:
and as well:
while excecuting 'plesk repair web.'
ps: Apache is even not anymore present as an option as php handler:
For info,
My nightmare started when I wanted to switch from FPM nginx to FastCGI Apache to handle my php request in order to make a test on heavy request which Nginx didn't like. Plesk failed and the following error message occured:
New configuration files for the Apache web server were not created due to the errors in configuration templates: Can not restart web server: . 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.See the details in Configuration Troubleshooter
Since then impossible to get Apache reconfigured and working.
@Jerome Nameche,
Hi! The issue seems to be a complex one and deserves an investigation. I can suggest contacting support according to the following KB article: https://support.plesk.com/hc/en-us/articles/213608509
Hi
I have the exact same issue following an update
Plesk on Debian 8 - OVH server
Apache web wont restart and i cannot do anything. We tried everything (plesk repair, plesk installer,..)
This is a nightmare. All our websites are down and plesk support does not help
@Benjamindjuidjidk
It is difficult to tell for sure what happened to Apache without any additional information. Please submit a support request as per the https://support.plesk.com/hc/en-us/articles/213608509-How-to-submit-a-request-to-Plesk-support- , we are always glad to help.
Hello,
I have the same problem on Debian 8 + plesk 12.5 and I followed the instructions in this topic, but nothing helped, I also replaced the certificates
Repair server-wide configuration parameters for web servers? [Y/n] y
Repairing server-wide configuration parameters for web servers .. [2020-05-29 14:43:23] ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/httpdmng' '--reconfigure-server'] with exit code [1]
Curl failed: SSL peer certificate or SSH remote key was not OK
[FAILED]
- httpdmng failed: [2020-05-29 14:43:22] ERR [util_exec]
proc_close() failed
['/opt/psa/admin/bin/apache_control_adapter' '--restart'
'--restart-interval' '0' '--http-port' '80' '--https-port'
'443'] with exit code [255]
Curl failed: SSL peer certificate or SSH remote key was not OK
[2020-05-29 14:43:22] ERR [panel] Apache config
(15907562000.58496000) generation failed: Template_Exception:
Can not restart web server: Service /etc/init.d/apache2 failed
to start
Service /etc/init.d/apache2 failed to start
file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php
line: 110
code: 0
Curl failed: SSL peer certificate or SSH remote key was not OK
Can not restart web server: Service /etc/init.d/apache2 failed
to start
Service /etc/init.d/apache2 failed to start
Hello Mariusz
In your case, the issue should have a cause different from the one in this article.
Plesk 12.5 has reached its End-of-Life but the issue might block the upgrade.
I would suggest one of the following approaches:
1. Submit a request to Plesk or our partner depending on where the license was purchased: https://support.plesk.com/hc/en-us/articles/213608509
2. (Recommended) Perform a migration to the server with modern Plesk version and newer OS version because Debian 8 is approaching it's EoL. Plesk instances with Debian 8 won't be supported since June 30, 2020: https://wiki.debian.org/LTS
I just updated from 18.0.29 to 18.0.30 MU #1 (Ubuntu 16.04) and I observe the same problem (see below).
Interestingly, it does not seem as if Apache2 has any issues starting. However, the config files do not seem to be regenerated.
I did not do the replacement of systemctl with systemctl_pp as this command does not seem to exist on my server. In addition, I reinstalled all patches and this did not help. apache2ctl -t and nginx -t do not indicate any error either.
Any idea?
Here's the command that i ran:
# plesk sbin httpdmng --reconfigure-all
Execution failed.
Command: httpdmng
Arguments: Array
(
[0] => --reconfigure-domains
[1] => (a list of host names)
)
Details: [2020-09-27 22:57:29.730] ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/apache_control_adapter' '--restart' '--restart-interval' '0' '--http-port' '7080' '--https-port' '7081'] with exit code [255]
[2020-09-27 22:57:39.263] ERR [panel] Apache config (16012400960.89657900) generation failed: Template_Exception: Can not restart web server:
file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php
line: 122
code: 0
Can not restart web server:
exit status 1
Is this related? https://talk.plesk.com/threads/after-upgrading-to-plesk-18-0-30-apache-stops-randomly.358149/
b_p
The issue in this article differs from the issue you've had and which is discussed in.
The fix for PPPM-12387 is indeed expected in 18.0.31, which will be available in a few weeks.
> Does it only happen rarely?
For now, we've had 1 support request only. The issue seems to be not wide-spread. We'll monitor this.
Ivan Postnikov Thanks for your immediate response! Looking at the forum, it seems a few people are affected, so is there maybe a help article for this bug which can visibly be linked on the top of this article (since this one shows up if you google for the problem). Or otherwise link at least to the solution on talk.plesk.com...
Please sign in to leave a comment.