0

我的 httpd.conf 中有这个:

<VirtualHost *:80>
DocumentRoot "/var/www/html/example.com"
ServerName www.example.com
ServerAlias example.com

ErrorLog "%{DOCUMENT_ROOT}/error_log"

    <Directory /var/www/html/example.com>
        AllowOverride all
        #Require all granted
        #allow from all
       Options -Indexes
    </Directory>
</VirtualHost>

当我执行 sudo service httpd restart 我得到:

No such file or directory: AH02291: Cannot access directory '/etc/httpd/%{DOCUMENT_ROOT}/' for error log of vhost defined at /etc/httpd/conf/httpd.conf:380 AH00014: Configuration check failed

有没有办法将错误日志设置到虚拟主机的文档根目录?谢谢。

4

1 回答 1

0

您必须替换 Apache 2.2 配置:

 Order allow,deny
 Allow from all

使用 Apache 2.4 配置:

  Require all granted

http://httpd.apache.org/docs/2.4/upgrading.html

于 2015-06-11T23:07:57.487 回答