{"id":11554,"date":"2022-01-05T15:43:28","date_gmt":"2022-01-05T20:43:28","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=11554"},"modified":"2022-01-05T15:43:32","modified_gmt":"2022-01-05T20:43:32","slug":"enable-mod_headers-apache-ubuntu","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/","title":{"rendered":"How to Enable mod_headers in Apache Ubuntu | Debian"},"content":{"rendered":"\n

There are a bunch of useful Apache modules that allow users to control and modify HTTP requests and response headers from the Apache server<\/a>. Today you will learn how to enable mod_headers in Apache Ubuntu<\/a> and Debian<\/a>-based Linux systems.<\/p>\n\n\n\n

Apache modules need to be enabled before you can use them. Some are enabled by default on installation while others must be enabled explicitly before use. Using a feature from a module that has not been enabled would result in an Internal Server Error. mod_headers is already installed in Apache (httpd) on Redhat\/Fedora\/CentOS<\/a> distros by default.<\/p>\n\n\n\n

Enable mod_headers<\/h2>\n\n\n\n

You can enable any Apache module, in this case, mod_headers, using the a2enmod command in the format:<\/p>\n\n\n\n

$sudo a2enmod <module_name><\/code><\/pre>\n\n\n\n

This would be the actual command to run:<\/p>\n\n\n\n

$ sudo a2enmod headers<\/code><\/pre>\n\n\n\n

Next, restart the Apache webserver for changes to take effect:<\/p>\n\n\n\n

$ sudo systemctl restart apache2<\/code><\/pre>\n\n\n\n

Check if mod_headers have been enabled and working using these:<\/p>\n\n\n\n

$ apachectl -M | headers<\/code><\/pre>\n\n\n\n

or<\/p>\n\n\n\n

$ apache2ctl -M | grep headers<\/code><\/pre>\n\n\n\n

With a similar line to this in the output:<\/p>\n\n\n\n

headers_module (shared)<\/code><\/pre>\n\n\n\n

What if I Want to Disable mod_headers<\/h2>\n\n\n\n

If you want to disable any Apache module including mod_headers, you need to run the a2dismod command:<\/p>\n\n\n\n

$ sudo a2dismod headers<\/code><\/pre>\n\n\n\n

Restart Apache webserver to apply changes.<\/p>\n","protected":false},"excerpt":{"rendered":"

There are a bunch of useful Apache modules that allow users to control and modify HTTP requests and response headers from the Apache server. Today you will learn how to…<\/p>\n","protected":false},"author":1,"featured_media":11556,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,28,16],"tags":[58,121,183,193,313,320,350,424,433,449,471,526,531,591,598,635,636],"yoast_head":"\nHow to Enable mod_headers in Apache Ubuntu | Debian<\/title>\n<meta name=\"description\" content=\"Do this to enable mod_headers in Apache web server on Ubuntu 22.04 or any Debian-based Linux system. Centos, Fedora, RHEL are already enabled\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Enable mod_headers in Apache Ubuntu | Debian\" \/>\n<meta property=\"og:description\" content=\"Do this to enable mod_headers in Apache web server on Ubuntu 22.04 or any Debian-based Linux system. Centos, Fedora, RHEL are already enabled\" \/>\n<meta property=\"og:url\" content=\"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Brightwhiz.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/brightwhiz\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-01-05T20:43:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-05T20:43:32+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/enable-mod_headers-apache-ubuntu.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"680\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Bright\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:site\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Bright\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/\"},\"author\":{\"name\":\"Michael Bright\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\"},\"headline\":\"How to Enable mod_headers in Apache Ubuntu | Debian\",\"datePublished\":\"2022-01-05T20:43:28+00:00\",\"dateModified\":\"2022-01-05T20:43:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/\"},\"wordCount\":202,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/enable-mod_headers-apache-ubuntu.jpg\",\"keywords\":[\"Apache\",\"CentOS\",\"Debian\",\"DevOps\",\"InfoSec\",\"Internet\",\"Libraries\",\"Open Source\",\"Optimization\",\"Performance\",\"Programming\",\"Security\",\"Server\",\"Tools\",\"Ubuntu\",\"Web\",\"Web Applications\"],\"articleSection\":[\"Articles\",\"Guides\",\"Software\",\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/\",\"url\":\"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/\",\"name\":\"How to Enable mod_headers in Apache Ubuntu | Debian\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/enable-mod_headers-apache-ubuntu.jpg\",\"datePublished\":\"2022-01-05T20:43:28+00:00\",\"dateModified\":\"2022-01-05T20:43:32+00:00\",\"description\":\"Do this to enable mod_headers in Apache web server on Ubuntu 22.04 or any Debian-based Linux system. Centos, Fedora, RHEL are already enabled\",\"breadcrumb\":{\"@id\":\"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/#primaryimage\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/enable-mod_headers-apache-ubuntu.jpg\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/enable-mod_headers-apache-ubuntu.jpg\",\"width\":1280,\"height\":680,\"caption\":\"Enable mod_headers in Apache Ubuntu\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/local.brightwhiz\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Enable mod_headers in Apache Ubuntu | Debian\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/local.brightwhiz\/#website\",\"url\":\"http:\/\/local.brightwhiz\/\",\"name\":\"Brightwhiz.com\",\"description\":\"Best Tech guides, Tutorials, and News\",\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/local.brightwhiz\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/local.brightwhiz\/#organization\",\"name\":\"Brightwhiz\",\"url\":\"http:\/\/local.brightwhiz\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"width\":706,\"height\":135,\"caption\":\"Brightwhiz\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/brightwhiz\/\",\"https:\/\/x.com\/brightwhizmag\",\"https:\/\/instagram.com\/bright_whiz\/\",\"https:\/\/www.pinterest.com\/sobbayi\/\",\"https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\",\"name\":\"Michael Bright\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"caption\":\"Michael Bright\"},\"sameAs\":[\"https:\/\/sobbayi.com\"],\"url\":\"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Enable mod_headers in Apache Ubuntu | Debian","description":"Do this to enable mod_headers in Apache web server on Ubuntu 22.04 or any Debian-based Linux system. Centos, Fedora, RHEL are already enabled","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"How to Enable mod_headers in Apache Ubuntu | Debian","og_description":"Do this to enable mod_headers in Apache web server on Ubuntu 22.04 or any Debian-based Linux system. Centos, Fedora, RHEL are already enabled","og_url":"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/","og_site_name":"Brightwhiz.com","article_publisher":"https:\/\/www.facebook.com\/brightwhiz\/","article_published_time":"2022-01-05T20:43:28+00:00","article_modified_time":"2022-01-05T20:43:32+00:00","og_image":[{"width":1280,"height":680,"url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/enable-mod_headers-apache-ubuntu.jpg","type":"image\/jpeg"}],"author":"Michael Bright","twitter_card":"summary_large_image","twitter_creator":"@brightwhizmag","twitter_site":"@brightwhizmag","twitter_misc":{"Written by":"Michael Bright","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/#article","isPartOf":{"@id":"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/"},"author":{"name":"Michael Bright","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32"},"headline":"How to Enable mod_headers in Apache Ubuntu | Debian","datePublished":"2022-01-05T20:43:28+00:00","dateModified":"2022-01-05T20:43:32+00:00","mainEntityOfPage":{"@id":"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/"},"wordCount":202,"commentCount":0,"publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"image":{"@id":"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/enable-mod_headers-apache-ubuntu.jpg","keywords":["Apache","CentOS","Debian","DevOps","InfoSec","Internet","Libraries","Open Source","Optimization","Performance","Programming","Security","Server","Tools","Ubuntu","Web","Web Applications"],"articleSection":["Articles","Guides","Software","Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/","url":"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/","name":"How to Enable mod_headers in Apache Ubuntu | Debian","isPartOf":{"@id":"http:\/\/local.brightwhiz\/#website"},"primaryImageOfPage":{"@id":"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/#primaryimage"},"image":{"@id":"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/enable-mod_headers-apache-ubuntu.jpg","datePublished":"2022-01-05T20:43:28+00:00","dateModified":"2022-01-05T20:43:32+00:00","description":"Do this to enable mod_headers in Apache web server on Ubuntu 22.04 or any Debian-based Linux system. Centos, Fedora, RHEL are already enabled","breadcrumb":{"@id":"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/#primaryimage","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/enable-mod_headers-apache-ubuntu.jpg","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/enable-mod_headers-apache-ubuntu.jpg","width":1280,"height":680,"caption":"Enable mod_headers in Apache Ubuntu"},{"@type":"BreadcrumbList","@id":"http:\/\/local.brightwhiz\/enable-mod_headers-apache-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/local.brightwhiz\/"},{"@type":"ListItem","position":2,"name":"How to Enable mod_headers in Apache Ubuntu | Debian"}]},{"@type":"WebSite","@id":"http:\/\/local.brightwhiz\/#website","url":"http:\/\/local.brightwhiz\/","name":"Brightwhiz.com","description":"Best Tech guides, Tutorials, and News","publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/local.brightwhiz\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/local.brightwhiz\/#organization","name":"Brightwhiz","url":"http:\/\/local.brightwhiz\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","width":706,"height":135,"caption":"Brightwhiz"},"image":{"@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/brightwhiz\/","https:\/\/x.com\/brightwhizmag","https:\/\/instagram.com\/bright_whiz\/","https:\/\/www.pinterest.com\/sobbayi\/","https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ"]},{"@type":"Person","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32","name":"Michael Bright","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","caption":"Michael Bright"},"sameAs":["https:\/\/sobbayi.com"],"url":"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/"}]}},"_links":{"self":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/11554"}],"collection":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/comments?post=11554"}],"version-history":[{"count":0,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/11554\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media\/11556"}],"wp:attachment":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media?parent=11554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/categories?post=11554"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/tags?post=11554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}