Post Date: 19 December 2020
Last Updated: 23 November 2026
Introduction
Apache internal server error messages can prevent visitors from accessing your website. One possible cause is an Apache configuration issue, which may appear in the error log with the following message:
Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration
This error occurs when the Apache mod_headers module is not enabled on an Ubuntu server.
In this tutorial, we will learn how to check whether the mod_headers module is enabled, activate it if necessary, and restart Apache to apply the changes.
Prerequisites
Before troubleshooting the Apache internal server error, make sure you have:
- An Ubuntu server running Apache.
- SSH access to the server.
- Sufficient permissions to enable Apache modules and restart the web server.
- Basic knowledge of Linux commands and Apache configuration.
- Access to the Apache error log to identify the reported error.
Steps to Fix the Apache Internal Server Error
Step 1: Check Whether the Apache Headers Module Is Enabled
First, check whether the mod_headers module is enabled in Apache by running the following command:
apache2ctl -M | grep headers

If the module is enabled, you should see the following output:
headers_module (shared)
If you do not get this output, enable the module using the following command:
a2enmod headers
Step 2: Restart the Apache Web Server
After enabling the module, restart the Apache web server for the changes to take effect:
service apache2 restart
Now, you can access your website through the browser.
If you continue experiencing the issue, you can contact our technical team for assistance with Apache configuration and server troubleshooting.
Frequently Asked Questions (FAQ)
1. What causes the Apache internal server error with the invalid ‘Header’ command?
This error occurs when the Apache mod_headers module is not enabled or loaded in the server configuration.
2. How can I check whether the mod_headers module is enabled?
Run the following command:
apache2ctl -M | grep headers
If the module is enabled, the output will include headers_module (shared).
3. How do I enable the mod_headers module in Ubuntu?
Run the following command:
a2enmod headers
4. Do I need to restart Apache after enabling mod_headers?
Yes. Restart Apache to apply the changes:
service apache2 restart
5. Will enabling mod_headers resolve the invalid ‘Header’ command error?
If the error is caused by the mod_headers module being disabled, enabling the module and restarting Apache should resolve it.
Conclusion
The Apache internal server error with the message Invalid command 'Header' can occur when the mod_headers module is not enabled.
You can resolve this issue by checking the module status, enabling it using a2enmod headers if necessary, and restarting the Apache web server.
Related Article
Official Documentation
Get Expert Support for Apache and Server Configuration
Resolving Apache errors often requires checking server modules and configuration settings to identify the cause of the problem. Pheonix Solutions provides technical services to help businesses maintain reliable websites and server environments through:
- Website development and troubleshooting: Website development services to resolve website functionality and configuration issues.
- Server and hosting management: DevOps and cloud services for Apache configuration, server administration, and hosting environments.
- Ongoing technical support: Software maintenance and support to help maintain website stability, security, and performance.
Need Assistance?
Still experiencing Apache internal server errors or having trouble with server configuration?
The technical team at Pheonix Solutions can help diagnose Apache configuration issues, troubleshoot server errors, manage hosting environments, and support your website infrastructure.
Contact our team to discuss your website and server support requirements.
