Apache Cannot be Started After Reinstall

As depicted below, there is the case in which an original install of Apache 2.4 on Ubuntu is not starting even after removing or purging the files in /etc/apache2 as well as reinstalling apache.


Ubuntu 14.04 and Ubuntu 16.04 have both gone End Of Life, this article is no longer maintained and you should update to a supported version.

apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: 
Syntax error on line 2 of /etc/apache2/mods-enabled/access_compat.load: 
Cannot load /usr/lib/apache2/modules/mod_access_compat.so into server: 
/usr/lib/apache2/modules/mod_access_compat.so: cannot open shared object file: No such file or directory
Action 'configtest' failed.

This is due to a configuration file that's trying to load a library trying to load a library (mod_access_compat.so) that it cannot find.

The file appears to be part of the apache2-bin package, therefore all its files must be present (installed) with:

$ sudo apt-get --reinstall install apache2-bin

Use the Feedback tab to make any comments or ask questions. You can also start a conversation with us.