31

how can I activate / install mod_headers on my server?

Stephane Rolland
  • 449
  • 2
  • 7
  • 14
Belgin Fish
  • 909
  • 5
  • 17
  • 30

2 Answers2

54

I'm taking a leap of faith assuming you are talking about a Debian/Ubuntu server here, as Redhat/Fedora/Centos have it installed and enabled as part of the default httpd installation.

On Debian/Ubuntu, you can enable mod_headers (it should be already installed as part of the apache2 installation), by running:

a2enmod headers
apache2 -k graceful
Andy
  • 3,705
  • 1
  • 19
  • 9
  • I run your last command and found some mistakes in my system. I think they come from wrongly set owners/permissions in Raspbian Jessie of the new user. I opened a new thread about it http://serverfault.com/q/780051/1944 – Léo Léopold Hertz 준영 May 31 '16 at 15:46
2

Here's to all those who got here, wanting to find out how to install mod_headers on WAMP / WAMPSERVER:

Since the list of available Apache modules doesn't have the "mod_"-prefix, you'll find it as "headers" in the Apache > Apache modules flyout menu.

And if you can't edit there, edit the wamp\bin\apache\apache\conf\httpd.conf file and comment or uncomment the line with "LoadModule mod_headers" at the beginning.

And in case WAMPSERVER / Apache doesn't start / restart following your changes (and the Apache error log has no entries), try starting the HTTP Deamon manually with wamp\bin\apache\apache\bin\httpd.exe - while this is no way to start Apache in WAMP during normal use (because that way it cannot find some libraries), this will help you debug and give you error messages on any errors in the configuration (which are attempted to be loaded before any libraries).