0

I have this in my 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>

When I do sudo service httpd restart I get:

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

Is there a way to set the error log to the documentroot of the virtualhost? Thanks.

varun21
  • 1
  • 1

1 Answers1

0

You have to replace Apache 2.2 configuration:

 Order allow,deny
 Allow from all

with Apache 2.4 configuration:

  Require all granted

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

simon
  • 3,378
  • 2
  • 22
  • 32