title: Setting Error_Log to VirtualHost Root in apache 2.4
body: <p>I have this in my httpd.conf:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
  DocumentRoot "/var/www/html/example.com"
  ServerName www.example.com
  ServerAlias example.com
  
  ErrorLog "%{DOCUMENT_ROOT}/error_log"
  
      &lt;Directory /var/www/html/example.com&gt;
          AllowOverride all
          #Require all granted
          #allow from all
         Options -Indexes
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>When I do sudo service httpd restart I get:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Is there a way to set the error log to the documentroot of the virtualhost? Thanks.</p>