[Solved] Job for apache2.service failed because the control process exited with error code.

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 ?

Enquirer: cyb3rZ

||

Solution #1:

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
Respondent: Treedbox

Solution #2:

Re-install apache2

sudo apt-get install apache2

And start your server

sudo service apache2 start

Solution #3:

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
Respondent: soldier

Solution #4:

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.

Respondent: jazeb007

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Leave a Reply

Your email address will not be published.