1

I have an Apache/2.4.18 server in Ubuntu 16.04 with PHP 7.0. I wanted to add in /etc/apache2./apache2.conf the following:

Header set X-XSS-Protection "1; mode=block" 

I have read that i must install mod_headers.cand to do the commands are:

a2enmod headers
sudo /etc/init.d/apache2 restart

Although when i do apache2 -l

Compiled in modules:

  core.c
  mod_so.c
  mod_watchdog.c
  http_core.c
  mod_log_config.c
  mod_logio.c
  mod_version.c
  mod_unixd.c

so mod_headers.c still does not exist.. What am i doing wrong here?

J.Doo
  • 13
  • 1
  • 3

1 Answers1

1

a2enmod will activate a dynamically loaded module. apache2 -l lists only modules statically compiled into the apache2 binary.

man apache2 reveals:

   -l     Output  a  list  of  modules compiled into the server. 
          This will not list dynamically loaded modules
          included using the LoadModule directive.

You can list all modules with this:

apachectl -t -D DUMP_MODULES

If the module is loaded, the output should include this line:

headers_module (shared)
Sven
  • 97,248
  • 13
  • 177
  • 225