Debugging Apache

Updated on 04 Apr 2020

It could be that when you attempt to start Apache you get an error messsage like what is shown below.

If you follow the instructions you could try

systemctl status apache2

You’ll get information about the status of Apache. In this case I have been lucky in that it is displaying the error message - i.e. the issue that I have in the configuration file.

apache2ctl configtest

You can actually test the configuration files with apache2ctl using the command below.

apache2ctl configtest

And it will highlight any issues that you have with your configuration. In mycase I forgot the closing > sign for the Directory tag.

Going into the the configuration file I can indeed see that line 31 does infact have a closing bracket that is missing.

Once fixed I can give apache2ctl configtest one last run to make sure everything with my configuration files is working as expected.