{"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 You can enable any Apache module, in this case, mod_headers, using the a2enmod command in the format:<\/p>\n\n\n\n This would be the actual command to run:<\/p>\n\n\n\n Next, restart the Apache webserver for changes to take effect:<\/p>\n\n\n\n Check if mod_headers have been enabled and working using these:<\/p>\n\n\n\n or<\/p>\n\n\n\n With a similar line to this in the output:<\/p>\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 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":"\nEnable mod_headers<\/h2>\n\n\n\n
$sudo a2enmod <module_name><\/code><\/pre>\n\n\n\n
$ sudo a2enmod headers<\/code><\/pre>\n\n\n\n
$ sudo systemctl restart apache2<\/code><\/pre>\n\n\n\n
$ apachectl -M | headers<\/code><\/pre>\n\n\n\n
$ apache2ctl -M | grep headers<\/code><\/pre>\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
$ sudo a2dismod headers<\/code><\/pre>\n\n\n\n