Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在apache 2.4中将错误日志设置为VirtualHost根目录_Apache_Amazon Ec2_Centos6.5 - Fatal编程技术网

在apache 2.4中将错误日志设置为VirtualHost根目录

在apache 2.4中将错误日志设置为VirtualHost根目录,apache,amazon-ec2,centos6.5,Apache,Amazon Ec2,Centos6.5,我的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

我的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>

有没有办法将错误日志设置为virtualhost的documentroot?谢谢。

您必须更换Apache 2.2配置:

 Order allow,deny
 Allow from all
  Require all granted
使用Apache 2.4配置:

 Order allow,deny
 Allow from all
  Require all granted