php - 安装mod_headers并重新启动apache后出错

标签 php linux apache .htaccess ubuntu

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

然后重新启动apache。

关于php - 安装mod_headers并重新启动apache后出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24631610/

相关文章:

linux - python : Permission denied error while setting up archive database

ruby-on-rails - 如何配置 Apache 以处理丢失的图像 Assets ?

Apache 从子域重写为 www 但保留所有永久链接

php - 按照给定列表中 ID 的顺序对数据进行排序

php - JavaScript:If 子句部分执行

php - 我应该如何设计 PHP 中 SQL 列生成器的接口(interface)?

linux - 如何将反引号传递给 Dockerfile CMD?

linux - 创建群组共享目录

css - 网站在实时服务器上时排版基线和大小发生变化

php - 在 Laravel 中获取 "Integrity constraint violation: 1452"