Stop Apache from writing duplicate log entries into access_log

Solution 1:

Remember that log directives within a VirtualHost section can conflict with log directives from the "Main" configuration sections. Duplicate log lines are often caused by a line like CustomLog /var/log/apache2/access_log in the main configuration section and a second CustomLog inside a VirtualHost section.

Grep for "access_log" in all of your configuration files to see if there is another section responsible for the duplicated log lines.

If you really want to have separate logs for your VirtualHost, then be sure to write to separate log files:

In the main HTTP configuration:

CustomLog /var/log/apache2/access_log

Inside the section:

CustomLog /var/log/apache2/www.thisvhost.org/access_log

To Keep It Simple and prevent confusion, I usually avoid any logging directives within the VirtualHost section. You can split out the logs based on their VirtualHost name later. Just be sure to use a format like "Common Log Format with Virtual Host" (%v or %V).

Another possibility. Is anything from syslog.conf writing to the file at /var/log/apache2/access_log ? This is doubtful, because syslog uses a different log format.