Solution:
Maybe this will help to trace the reason:
journalctl | tail
In my instance it was a mistake in the configuration file:
AH00526: Syntax error on line 5 of /etc/apache2/sites-enabled/mydomain-wsf.lan.conf
There is few syntax error in the file apache2.conf
.
In a terminal, type:
cd /etc/apache2
Then:
apache2ctl configtest
It will display you where is the error in the apache2.conf
file to correct
The issue is since few configuration files are deleted, you have to reinstall it.
REINSTALL APACHE2:
To replace configuration files that have been deleted, without purging the package, you can work:
sudo apt-get -o DPkg::Options::="--force-confmiss" --reinstall install apache2
To totally remove the apache2 config files, you must:
sudo apt-get purge apache2
which will then let you reinstall it in the simple method with:
sudo apt-get install apache2
Purge is necessary to remove all the config files - in case you delete the config files however just remove the package, then this is remembered & missing config files are not reinstalled by default.
Then REINSTALL PHP5:
apt-get purge libapache2-mod-php5 php5 && \
apt-get install libapache2-mod-php5 php5
I got the similar error after removing a virtual host. The problem was the lingering SSL conf file attached with that host located in /etc/apache2/sites-enabled
. The SSL was through Let's Encrypt hence the code for me to remove was:
sudo rm yourdomain.com-le-ssl.conf
in case you use
sudo apt-get install apache2
to install Apache2