I tried to restart my Apache after updating my config

sudo service apache2 restart

I kept getting this

Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.

How do I prevent that ?

4 Answers 4


Here is the answer: https://askubuntu.com/a/1022319/850782

cd /etc/apache2
apache2ctl configtest

probably has some typo in some config file that you have created:

vi /etc/apache2/sites-enabled/yoursite.conf

You may mixed up something in apache2 configuration better to remove and reinstall a fresh apache2 , Hope this will help you .

First uninstall apache2

sudo apt-get purge apache2
sudo apt-get purge apache2-common 
sudo apt-get purge apache* # this will remove completely

sudo apt-get update

Next install fresh apache2

sudo apt-get install apache2 

Next Check for the apache2 status

systemctl status apache2

In my case i was already running nginx server on the same PORT. So i used sudo service nginx stop then sudo service apache2 restart and it worked. netstat -plant | grep 80 use this command to see if port is already in use.


Re-install apache2

sudo apt-get install apache2

And start your server

sudo service apache2 start

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .