Symptoms
-
Plesk runs on RHEL-based OS (CentOS/RHEL/CloudLinux).
-
The following message appear on Plesk homepage or on attempt to start Apache at Tools & Settings > Services Management :
PLESK_ERROR: Warning: start service httpd failed /usr/local/psa/admin/sbin/pleskrc execution failed: Failed to start httpd.service: Unit not found. Unit httpd.service could not be found.
-
Apache does not start via Plesk > Tools & Settings > Services Management or via SSH:
PLESK_ERROR: Unable to start service: Unable to manage service by apache_control_adapter: (‘start’, ‘web’). Error: INFO: [Wed Apr 14 09:50:54 EEST 2021]: Service: apache, Action: start Trying to start service httpd… attempt to start service httpd – service doesn’t exist (missing unit file or not executable control script) ***** problem report ***** Warning: start service httpd failed /usr/local/psa/admin/sbin/pleskrc execution failed: Unit httpd.service could not be found.
# systemctl start httpd
Failed to restart httpd.service: Unit not found. -
Apache syntax has no errors:
# httpd -t
Syntax OK
-
Verification of Apache packages shows that the symlink to
httpd.service
was modified:# yum list installed | grep httpd
httpd.x86_64 2.4.6-93.el7.centos @base
httpd-tools.x86_64 2.4.6-93.el7.centos @base# rpm -V httpd.x86_64
…….T. c /etc/httpd/conf.modules.d/00-base.conf
…….T. c /etc/httpd/conf.modules.d/00-dav.conf
S.5….T. c /etc/httpd/conf.modules.d/00-mpm.conf
…….T. c /etc/httpd/conf.modules.d/00-proxy.conf
S.5….T. c /etc/httpd/conf/httpd.conf
S.5….T. c /etc/logrotate.d/httpd
….L…. /usr/lib/systemd/system/httpd.service
S.5….T. /usr/lib64/httpd/modules/mod_proxy.so
S.5….T. /usr/lib64/httpd/modules/mod_proxy_fcgi.so
SM5….TP /usr/sbin/suexec
-
LiteSpeed was previously activated on the server but now it is disabled at Extension Catalog > My Extensions:
Cause
LiteSpeed was not fully deactivated. The file /usr/lib/systemd/system/httpd.service
is a symlink to a non-existent LiteSpeed service /usr/lib/systemd/system/lshttpd.service:
# ls -lah /usr/lib/systemd/system/http*
lrwxrwxrwx 1 root root 39 /usr/lib/systemd/system/httpd.service -> /usr/lib/systemd/system/lshttpd.service
Resolution
-
Remove the Litespeed extension via Extension Catalog > My Extensions > LiteSpeed > More > Remove.
-
Connect to the server via SSH.
-
Find the old Apache and LiteSpeed
.service
files:# ls -lah /usr/lib/systemd/system/http*
lrwxrwxrwx 1 root root 39 /usr/lib/systemd/system/httpd.service -> /usr/lib/systemd/system/lshttpd.service# ls -lah /usr/lib/systemd/system/lshttpd*
lrwxrwxrwx 1 root root 39 /usr/lib/systemd/system/lshttpd.service -
Remove the old
httpd.service
files andlshttpd.service
files:# rm -rf /usr/lib/systemd/system/httpd.service*
# rm -rf /usr/lib/systemd/system/lshttpd.service* -
Create a new file
/usr/lib/systemd/system/httpd.service
and add the following content:# vi /usr/lib/systemd/system/httpd.service
[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target
Documentation=man:httpd(8)
Documentation=man:apachectl(8)
[Service]
Type=notify
EnvironmentFile=/etc/sysconfig/httpd
ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful
ExecStop=/bin/kill -WINCH…