• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Resolved Can't start apache via Plesk

dasaweb

New Pleskian
Hi,

I'm using Plesk Onyx (Version 17.0.17 Update #15) on an Ubuntu 14.04.5 LTS‬. If I change anything in the Plesk setting that needs a restart of the Apache webserver the Apache crashes. Or to be more precisely: I see in the Apache error log that the webserver can be shuted down, but it is not restarted. I can start the webserver by typing "/etc/init.d/apache2 start" as root, no problem. And in that moment the changes in the Plesk backend are successfully finished.

Looking at https://mydomain:8443/admin/services/list I see that the service "Apache (Webserver)" is never running, although he is running (all the websites are running, "/etc/init.d/apache2 status" says "running"). If I try to click to the "Start service" button nothing happens, no matter the webservice is started in the shell or not.

Any ideas? This sounds like a not so important issue, but the consequences are for example that everyone changings someting via Plesk need to restart the server as root, which is not possible. Not to mention crashing cronjobs and so on...

Thank's for your help!
Daniel
 
How was Apache installed on that system? It seems that the Apache you are using is not connected with Plesk, but is a separate, manual installation.
 
How was Apache installed on that system? It seems that the Apache you are using is not connected with Plesk, but is a separate, manual installation.
Apache was pre-installed on the system, and in the beginning it could be controlled by Plesk. I have no idea at which point it lost the connection to Plesk. Could "apt-get update" a problem?
In the list of installed components (https://mydomain:8447/add_components.html) Apache is still checked (green).

How can I figure out if I use a manually installed Apache version? Or how could I fix it? Uninstall Apache in the command line and also via Plesk and re-install it using the Plesk installer?
 
Looks like a Plesk cannot properly determined a status of apache. Can you check that status of service in system and status of service plesk are equal:
by checking /usr/local/psa/admin/sbin/websrvmng --status command and /etc/init.d/apache2 status when apache is stopped and started?
 
Looks like a Plesk cannot properly determined a status of apache. Can you check that status of service in system and status of service plesk are equal:
by checking /usr/local/psa/admin/sbin/websrvmng --status command and /etc/init.d/apache2 status when apache is stopped and started?

Thank you for your help! I do not know exactly what the difference between the two commands is (and yes, that maybe the point why I have this problem...). Usually I test the status by /etc/init.d/apache2 status. Here are the two outputs:
  • /etc/init.d/apache2 status > "apache is running"
  • /usr/local/psa/admin/sbin/websrvmng --status > "is stopped"
I tried now to stop "the apache" and start "the webserver", but I could not start it using /usr/local/psa/admin/sbin/websrvmng --start. After nearly a minute it says: "websrvmng: /opt/psa/admin/sbin/apache_control_adapter execution failed:" Is there a logfile where I could check what websrvmng does?
 
Hello,

You can check /var/log/plesk/rc_actions.log, also you can run /bin/bash -x /opt/psa/admin/sbin/pleskrc apache2 status and check the output
 
Hello,

You can check /var/log/plesk/rc_actions.log, also you can run /bin/bash -x /opt/psa/admin/sbin/pleskrc apache2 status and check the output

/bin/bash -x /opt/psa/admin/sbin/pleskrc apache2 status gives over 400 lines of output, nothing helpful (for me :-/). Trying to start the webserver using /opt/psa/admin/sbin/pleskrc apache2 start it says:

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'
INFO: [Wed Feb 15 08:30:44 CET 2017]: Serice: apache2, Action: start
Trying to start service apache2... unknown

WARNING!
Some problems are found during start service apache2(see log file: /var/log/plesk/rc_actions.log)

Continue...


And in /var/log/plesk/rc_actions.log:

START pleskrc
INFO: [Wed Feb 15 08:30:44 CET 2017]: Serice: apache2, Action: start
Trying to start service apache2... unknown

WARNING!
Some problems are found during start service apache2(see log file: /var/log/plesk/rc_actions.log)

Continue...

STOP pleskrc


Any ideas?
 
Hello,

It seems you have systemd installed on Ubuntu 14.04. Unfortunately Plesk doesn't work well with such old version of systemd. You can either switch back to upstart, or for immediate solution you can disable systemctl calls in pleskrc by executing sed -i.orig s/systemctl/systemctl_pp/g /opt/psa/admin/sbin/pleskrc

Note, changes in pleskrc will be overwritten during Plesk upgrades
 
Hello,

It seems you have systemd installed on Ubuntu 14.04. Unfortunately Plesk doesn't work well with such old version of systemd. You can either switch back to upstart, or for immediate solution you can disable systemctl calls in pleskrc by executing sed -i.orig s/systemctl/systemctl_pp/g /opt/psa/admin/sbin/pleskrc

Note, changes in pleskrc will be overwritten during Plesk upgrades

Hi,

to be honest, I am not really familiar with SysV vs. systemd vs. upstart, and changing completely from systemd back to upstart doesn't seem to be trivial... So I created a copy of the systemctl file and then changed "systemctl" to "systemctl_pp" following your advice. And it works, thanks a lot!

BTW: What does "systemctl_pp" exactly do? Nothing, just aborting? Searching for "systemctl_pp" I only found this discussion here and this article describing exactly your solution: https://support.plesk.com/hc/en-us/...Template-Exception-Can-not-restart-web-server
 
The pleskrc script check for presence of /bin/systemtctl file, and if it found - it will use it, so the fix just tell pleskrc to check systemctl_pp instead, which doesn't exists, and in this case pleskrc will use SysVinit scripts instead.

AFAIK Ubuntu 14 by default comes with upstart, and systemd is optional. Could you tell how do you got systemd - select on installation phase, manual switch, or this server was preinstalled by provider?
 
AFAIK Ubuntu 14 by default comes with upstart, and systemd is optional. Could you tell how do you got systemd - select on installation phase, manual switch, or this server was preinstalled by provider?
No idea. The machine is a pre-installed virtual server (Strato), and I'm not sure if it was running systemd or upstart at the beginning. As I mentioned I am not very familiar with systemd / upstart / SysVinit, so if I was the one who changed the init method from upstart to systemd, then that was not on purpose...
 
Hello, i'm getting a similar issue... but here either `/usr/local/psa/admin/sbin/websrvmng --status` and `/etc/init.d/apache2 status` return **is running**.

When I open the Web Plesk panel, the follow error is shown:

```
New configuration files for the Apache web server were not created due to the errors in configuration templates: Can not restart web server: httpd stop failed 11 /usr/sbin/apache2 processes are killed INFO: [Sat Aug 25 11:24:12 -03 2018]: Service: apache2, Action: start Trying to start service apache2... inactive WARNING! Some problems are found during start service apache2(see log file: /var/log/plesk/rc_actions.log) Continue... /opt/psa/admin/sbin/pleskrc execution failed: 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' . 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
```

Followed by a message in green:

```
Information: Web server reconfiguration is completed: New configuration files were successfully built and applied.
```

I'm using Ubuntu 14.04. `systemctl` was installed but I already removed it with `apt-get remove systemd`. I'm using **Plesk Onyx 17.8.11 Update #17**.

Hope to find a help...

Thanks.
 

Attachments

  • Websites_and_Domains.png
    Websites_and_Domains.png
    196.2 KB · Views: 9
Back
Top