Solution Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration

Once I transferred one site from one server to another Ubuntu server and after installing Apache2 I noticed the following error in the logs:

Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration

The error occurred due to the fact that the headers module was not activated, check if it is loaded (“headers_module (shared)” should be displayed):

apachectl -M | grep head

To activate it, you need to run the command:

sudo a2enmod headers

And restart apache2:

sudo service apache2 restart

After that, the error disappeared.

See my other articles on Apache2

Leave a comment

Leave a Reply