{"id":5995,"date":"2020-12-19T09:28:05","date_gmt":"2020-12-19T03:58:05","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=5995"},"modified":"2026-11-23T09:45:08","modified_gmt":"2026-11-23T04:15:08","slug":"how-to-solve-the-website-internal-server-error-from-the-following-apache-error-loginvalid-command-header-perhaps-misspelled-or-defined-by-a-module-not-included-in-the-server-config","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-solve-the-website-internal-server-error-from-the-following-apache-error-loginvalid-command-header-perhaps-misspelled-or-defined-by-a-module-not-included-in-the-server-config\/","title":{"rendered":"How to Fix the Apache Internal Server Error: Invalid Command &#8216;Header&#8217;"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Post Date:<\/strong> 19 December 2020<br><strong>Last Updated: <\/strong>23 November 2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Apache internal server error<\/strong> 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:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This error occurs when the Apache <code>mod_headers<\/code> module is not enabled on an Ubuntu server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial, we will learn how to check whether the <code>mod_headers<\/code> module is enabled, activate it if necessary, and restart Apache to apply the changes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before troubleshooting the Apache internal server error, make sure you have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>An Ubuntu server running Apache.<\/li>\n\n\n\n<li>SSH access to the server.<\/li>\n\n\n\n<li>Sufficient permissions to enable Apache modules and restart the web server.<\/li>\n\n\n\n<li>Basic knowledge of Linux commands and Apache configuration.<\/li>\n\n\n\n<li>Access to the Apache error log to identify the reported error.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Steps to Fix the Apache Internal Server Error<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Check Whether the Apache Headers Module Is Enabled<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">First, check whether the <code>mod_headers<\/code> module is enabled in Apache by running the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apache2ctl -M | grep headers<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/image.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"71\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/image-1024x71.png\" alt=\"Apache internal server error troubleshooting: Checking whether the Apache mod_headers module is enabled using the apache2ctl command.\" class=\"wp-image-13799\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/image-1024x71.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/image-300x21.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/image-768x54.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/image.png 1032w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If the module is enabled, you should see the following output:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">headers_module (shared)<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you do not get this output, enable the module using the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">a2enmod headers<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Restart the Apache Web Server<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">After enabling the module, restart the Apache web server for the changes to take effect:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">service apache2 restart<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, you can access your website through the browser.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you continue experiencing the issue, you can <a href=\"https:\/\/pheonixsolutions.com\/contact\/\">contact our technical team<\/a> for assistance with Apache configuration and server troubleshooting.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions (FAQ)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. What causes the Apache internal server error with the invalid &#8216;Header&#8217; command?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This error occurs when the Apache <code>mod_headers<\/code> module is not enabled or loaded in the server configuration.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. How can I check whether the mod_headers module is enabled?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apache2ctl -M | grep headers<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the module is enabled, the output will include <code>headers_module (shared)<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. How do I enable the mod_headers module in Ubuntu?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">a2enmod headers<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4. Do I need to restart Apache after enabling mod_headers?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Restart Apache to apply the changes:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">service apache2 restart<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">5. Will enabling mod_headers resolve the invalid &#8216;Header&#8217; command error?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the error is caused by the <code>mod_headers<\/code> module being disabled, enabling the module and restarting Apache should resolve it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Apache internal server error with the message <code>Invalid command 'Header'<\/code> can occur when the <code>mod_headers<\/code> module is not enabled.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can resolve this issue by checking the module status, enabling it using <code>a2enmod headers<\/code> if necessary, and restarting the Apache web server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Article<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-enable-http2-support-in-apache\/\">How to Enable HTTP\/2 Support in Apache<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Official Documentation<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/httpd.apache.org\/docs\/\" target=\"_blank\" rel=\"noopener\">Apache HTTP Server Documentation<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/httpd.apache.org\/docs\/current\/mod\/mod_headers.html\" target=\"_blank\" rel=\"noopener\">Apache mod_headers Documentation<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Get Expert Support for Apache and Server Configuration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Resolving Apache errors often requires checking server modules and configuration settings to identify the cause of the problem. <a href=\"https:\/\/pheonixsolutions.com\/\">Pheonix Solutions<\/a> provides technical services to help businesses maintain reliable websites and server environments through:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Website development and troubleshooting:<\/strong> <a href=\"https:\/\/pheonixsolutions.com\/web-development\/\">Website development services<\/a> to resolve website functionality and configuration issues.<\/li>\n\n\n\n<li><strong>Server and hosting management:<\/strong> <a href=\"https:\/\/pheonixsolutions.com\/devops-cloud\/\">DevOps and cloud services<\/a> for Apache configuration, server administration, and hosting environments.<\/li>\n\n\n\n<li><strong>Ongoing technical support:<\/strong> <a href=\"https:\/\/pheonixsolutions.com\/software-maintenance-and-support\/\">Software maintenance and support<\/a> to help maintain website stability, security, and performance.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Need Assistance?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Still experiencing Apache internal server errors or having trouble with server configuration?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The technical team at <a href=\"https:\/\/pheonixsolutions.com\/devops-cloud\/\">Pheonix Solutions<\/a> can help diagnose Apache configuration issues, troubleshoot server errors, manage hosting environments, and support your website infrastructure.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/contact\/\"><strong>Contact our team<\/strong><\/a> to discuss your website and server support requirements.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post Date: 19 December 2020Last Updated: 23 November 2026 Introduction Apache internal server error messages can prevent visitors from accessing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":13800,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[398,528,274],"class_list":["post-5995","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-architecture","tag-apache2","tag-htaccess-2","tag-ubuntu","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1yH","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/Fixing-Apaches-Invalid-Header-Error.webp","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5995","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=5995"}],"version-history":[{"count":4,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5995\/revisions"}],"predecessor-version":[{"id":13804,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5995\/revisions\/13804"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media\/13800"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=5995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=5995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=5995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}