2 Replies - 4690 Views - Last Post: 26 March 2008 - 06:40 PM

#1 girasquid  Icon User is offline

  • Barbarbar
  • member icon

Reputation: 108
  • View blog
  • Posts: 1,825
  • Joined: 03-October 06

Apache global log and awstats virtualhosts logs

Posted 26 March 2008 - 11:43 AM

Hello, all.

I'm currently working with an Apache server that is running 3 websites(although eventually there will be more).

I have set up awstats to analyze the access logs for each of these sites, along with logrotate to make sure that my log files do not become too large.

I have to pay the co-location facility that my server is located in so many $/GB of bandwidth, and so I would like to monitor both the global Apache access log, and the logs for each individual virtualhost(so I can bill them all separately). According to Apache's configuration file, it is writing its access log to /var/log/apache2/access.log, but that logfile is empty - I assume that this is because the virtualhost access log directives are overriding it and preventing it from being written to.

Does anyone know how I would need to configure Apache to make sure that it writes to both the virtualhost's access.log, and the global access.log?

Thanks,
Girasquid

Is This A Good Question/Topic? 0
  • +

Replies To: Apache global log and awstats virtualhosts logs

#2 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5364
  • View blog
  • Posts: 27,325
  • Joined: 10-May 07

Re: Apache global log and awstats virtualhosts logs

Posted 26 March 2008 - 06:07 PM

View Postgirasquid, on 26 Mar, 2008 - 11:43 AM, said:

Does anyone know how I would need to configure Apache to make sure that it writes to both the virtualhost's access.log, and the global access.log?

Each virtual host in the apache config (httpd.conf) has it's own log file. Each virtual host should use it's own logging file. I even go as far as to create sub directories for each virtual host in the log directory. Also, there is a setting you'll need to make in the apache configs to enable extended monitoring, to give you full results. I'll dig through some documentation & get back to you on that.
Was This Post Helpful? 0
  • +
  • -

#3 girasquid  Icon User is offline

  • Barbarbar
  • member icon

Reputation: 108
  • View blog
  • Posts: 1,825
  • Joined: 03-October 06

Re: Apache global log and awstats virtualhosts logs

Posted 26 March 2008 - 06:40 PM

Great, thank you.

Another option that I've heard mentioned would be to log the names of the virtualhosts, and keep it all in one large access.log - that way, I can filter out virtualhost-specific log data by running something along the same lines as "grep virtualhostname" - but I'm not sure exactly how well that would work.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1