Configure logs in Apache for virtualhost

First of all, let’s distinguish between error logs and access logs.

In this guide you can see how:

http://www.sitepoint.com/configuring-web-logs-apache/
https://www.digitalocean.com/community/tutorials/how-to-configure-logging-and-log-rotation-in-apache-on-an-ubuntu-vps

But, I noticed that there was not info in the apache /var/log/apache2.access log

The trick is to add one line to the virtualhost that you would like to control:

CustomLog /var/log/apache/www.foo.com-access.log combined

source: http://wiki.apache.org/httpd/ExampleVhosts

Advertisements