Unable to restart Apache2

Posted February 29, 2020 1.9k views


I have upgraded Ubuntu 12 to 16 after completion i am unable to start Apache2, I am getting following error when i am starting apache2

“job for apache2.service failed because the control process exited with error code”

could you please solve?


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Hi @rajviswas,

Before we can provide you with the way to solve it, we’ll need to know what the exact error is. There are a couple of ways to go about getting the exact error.

One is to try and start Apache and when it fails to check your Apache Errorlog. The default installation for Apache2 on Ubuntu creates a log subdirectory: /var/log/apache2. Within this subdirectory are two log files with two distinct purposes: /var/log/apache2/access. log - records of every page served and every file loaded by the web server. The second file is the errorlog providing every error generated by Apache. You can get yours there.

The second way would be again to try and restart Apache and when it fails, to run the command

journalctl -xe

It will again provide you with the experienced error.

As soon as you do, you can post it here for more information


Hello, @rajviswas

Have you checked the Apache configuration for any syntax errors? You can do this using the following command:

apache2ctl configtest

You can also check the journal log as that will give you a better idea about what happened:

sudo journalctl -xe

You can check the Apache error log as well. The location of the log file should be:

/var/log/apache2/error.log and you can simply tail the log using:

tail -f /var/log/apache2/error.log

or tail the last 100 entries of it:

tail -n 100 /var/log/apache2/error.log

Let me know how it goes.


  • i got following error when i submitted this command apache2ctl configtest

    root@raja-1464765401817-512mb-blr1-01:~# apache2ctl configtest

    AH00526: Syntax error on line 40 of /etc/sentora/configs/apache/httpd-vhosts.conf:

    Invalid command ‘phpadminvalue’, perhaps misspelled or defined by a module not included in the server configuration
    Action 'configtest’ failed.

    The Apache error log may have more information.

    • Hello @rajviswas

      You need to sort the syntax error in the configuration file. In order to open the file at the exact row you can use one of the following commands (you can use your preferred text editor - vi, vim or nano )

      nano +40 /etc/sentora/configs/apache/httpd-vhosts.conf
      vi +40 /etc/sentora/configs/apache/httpd-vhosts.conf
      vim +40 /etc/sentora/configs/apache/httpd-vhosts.conf

      You can comment out the entire row using # so the row/line can be:


      Hope this helps!