安装mod_headers并重启apache后出现错误


Error after Install mod_headers and restart apache

sudo a2enmod headers
Enabling module headers.
To activate the new configuration, you need to run:
  service apache2 restart
root@example:~# service apache2 restart
 * Restarting web server apache2                                                                                                                                 [fail]
 * The apache2 configtest failed.
Output of config test was:
AH00526: Syntax error on line 38 of /etc/apache2/apache2.conf:
Argument for 'Require all' must be 'granted' or 'denied'
Action 'configtest' failed.
The Apache error log may have more information.

错误日志

01:30:26.678410 2014] [core:alert] [pid 5711] [client myid:15424] /var/www/.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration
[Tue Jul 08 01:30:39.256270 2014] [core:alert] [pid 5722] [client myid:31850] /var/www/.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration
[Tue Jul 08 01:36:12.821198 2014] [core:alert] [pid 5710] [client myid:21182] /var/www/.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration
[Tue Jul 08 01:48:08.278465 2014] [mpm_prefork:notice] [pid 5705] AH00169: caught SIGTERM, shutting down

如果您的apache配置在

Require all granted # new config style (replaces both rules above)

改为

Require all granted