Mail your problems to us on lawania@lavania.in, we will solve it and put the solution here at Lawania.com

Apache not able to restart

Trying to restart apache from terminal using following command:

 sudo service apache2 restart


when executing that command getting below error:

Job for apache2.service failed. See "systemctl status apache2.service" and "journalctl -xe" for details. 
 
SOLUTION 1
 
Maybe this will help to find the cause:

journalctl | tail
In my case it was a mistake in the configuration file:
 
AH00526: Syntax error on line 5 of /etc/apache2/sites-enabled/mydomain-wsf.lan.conf


SOLUTION 2
 
REINSTALL APACHE2:

To replace configuration files that have been deleted, without purging the package, you can do:
 
sudo apt-get -o DPkg::Options::="--force-confmiss" --reinstall install apache2

To fully remove the apache2 config files, you should:
 
sudo apt-get purge apache2

which will then let you reinstall it in the usual way with:
 
sudo apt-get install apache2

Purge is required to remove all the config files - if you delete the config files but only 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
 
 
Share on Google Plus

About Prof Krishan Kant Lavania

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.