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 :
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.
-
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 ${MAINPID}
# We want systemd to give httpd some time to finish gracefully, but still want
# it to kill httpd after TimeoutStopSec if something went wrong during the
# graceful stop. Normally, Systemd sends SIGTERM signal right after the
# ExecStop, which would kill httpd. We are sending useless SIGCONT here to give
# httpd time to finish.
KillSignal=SIGCONT
PrivateTmp=true
[Install]
WantedBy=multi-user.target -
Start Apache service:
# systemctl start httpd