Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[ content removed, DMCA ]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Cheesepie
Apprentice
Apprentice


Joined: 19 Jan 2004
Posts: 154

PostPosted: Tue Feb 14, 2006 10:25 pm    Post subject: [ content removed, DMCA ] Reply with quote

[ content removed, DMCA ]

Last edited by Cheesepie on Thu Feb 09, 2023 12:29 am; edited 2 times in total
Back to top
View user's profile Send private message
cogitate
n00b
n00b


Joined: 05 Dec 2003
Posts: 46
Location: Ontario, Canada

PostPosted: Wed Feb 15, 2006 1:29 am    Post subject: Reply with quote

If you want to split the log files for processing later, rather than have a separate log file for each host, you can use the split-logfile utility that comes with apache. It can also be used in a pipe situation if you want the logs to be created on the fly (without rotating the logs first) in a CustomLog directive.
Code:
CustomLog "| /usr/sbin/split-logfile2 /var/log/apache2" combined

The only condition to this is that the log format must begin with '%v ' to log the virtual host, regardless of which method you use.
Back to top
View user's profile Send private message
JustJoe
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jul 2005
Posts: 80

PostPosted: Wed Feb 15, 2006 7:16 am    Post subject: Reply with quote

You can configure the CustomLog directive for each virtual host, as well as an error log for each virtual host:
Code:

<VirtualHost *:80>
ServerName foo.bar
DocumentRoot /var/www/foo.bar/htdocs/
  ErrorLog logs/foo.bar_error_log
  CustomLog logs/foo.bar_access_log combined
</VirtualHost>

<VirtualHost *:80>
ServerName bar.foo
DocumentRoot /var/www/bar.foo/htdocs/
  ErrorLog logs/bar.foo_error_log
  CustomLog logs/bar.foo_access_log combined
</VirtualHost>


I choose for 'combined' logs, that is the logformat AWStats can handle.
Back to top
View user's profile Send private message
Cheesepie
Apprentice
Apprentice


Joined: 19 Jan 2004
Posts: 154

PostPosted: Wed Feb 15, 2006 5:34 pm    Post subject: Reply with quote

[ content removed, DMCA ]

Last edited by Cheesepie on Thu Feb 09, 2023 12:39 am; edited 1 time in total
Back to top
View user's profile Send private message
JustJoe
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jul 2005
Posts: 80

PostPosted: Wed Feb 15, 2006 9:43 pm    Post subject: Reply with quote

Cheesepie wrote:


FYI, this does not apply to my problem as I am using dynamic virtualhosts (not <virtualhost> blocks)


Ah, dynamic... missed that. :oops:
Back to top
View user's profile Send private message
murad
n00b
n00b


Joined: 29 Oct 2003
Posts: 44
Location: Rio de Janeiro, Brasil

PostPosted: Sat Jun 10, 2006 12:34 am    Post subject: Reply with quote

If you want here is a reimplementation of apache2splitlogfile that will create 2 log files for each domain. One is the log file for the domain and the second is a log file with the traffic spent per month.
_________________
Marcelo Mustafa Murad
http://dtmconsultoria.com
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum