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

Enabling Apache logs in MAMP Pro

MAMP Pro uses a template to configure the apache configuration file. So you have to open MAMP  Pro and open templates apache, as described here

http://documentation.mamp.info/en/mamp-pro/advanced-functions/edit-configuration-files

Then change the lines as explained here

http://documentation.mamp.info/en/mamp/faq/where-can-i-find-the-logs/how-can-i-enable-the-apache-access-logs

and restart apache!

You will now be able to see the logs in real time using
tail -f /Applications/MAMP/logs/apache_access.log