I have two virtual hosts on my server pointing towards two separate rails applications. I wanted to create two separate error.log files for each application. I tried to set ErrorLog directive within VirtualHost.
<VirtualHost *:80>
ServerName demo2.questionscube.com
DocumentRoot /home/ubuntu/site-git/html_data
<Directory /home/ubuntu/site-git/html_data>
AllowOverride all
Options -MultiViews
ErrorLog ${APACHE_LOG_DIR}/site-error.log
</Directory>
But it gives an error saying
ErrorLog not allowed here
What should I do?
You should put the ErrorLog directive in the VirtualHost, not Directory section.
See virtual host documentation