Symptoms
- The following error occurs on attempt to upgrade Plesk:
Setting up apache2 (2.4.18-2ubuntu3.5) ...
insserv: script apache2: service lsws already provided!
info: Executing deferred 'a2enmod php7.0' for package libapache2-mod-php7.0
insserv: script apache2: service lsws already provided!
insserv: exiting now!
update-rc.d: error: insserv rejected the script header
dpkg: error processing package apache2 (--configure):
subprocess installed post-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)
Unable to upgrade Plesk: update-rc.d: error: insserv rejected the script header - Apache2 is shown as half configured:
# dpkg -l | grep apache2
iF apache2 2.4.18-2ubuntu3.5 amd64 Apache HTTP Server - Init script for Apache2 is a symbolic lint to the LiteSpeed init script:
# ls -l /etc/init.d/apache2
lrwxrwxrwx 1 root root 6 Mar 18 12:49 /etc/init.d/apache2 -> ./lsws
Cause
Incorrect script provided by LiteSpeed.
Resolution
- Log into the server via SSH.
- Remove a symbolic link:
# unlink /etc/init.d/apache2
- Restore the original Apache2 init script from the backup created by LiteSpeed:
# cp -a /etc/init.d/apache2.ls_bak /etc/init.d/apache
- Initialize the upgrade once again.
Another solution is to switch back to Apache via Extensions >Â LiteSpeed Extension.
Note: as LiteSpeed is not officially supported by Plesk, contact LiteSpeed support regarding the issue with /etc/init.d/lsws
script in case it is required to use it as a symbolic link:
https://www.litespeedtech.com/supportÂ