Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 18th May 2007, 13:16
meemu meemu is offline
Member
 
Join Date: Apr 2007
Posts: 39
Thanks: 2
Thanked 8 Times in 5 Posts
Default Exclude requests from own IPs in clients' logs

I noticed after a transferring a site from our old web server to the new ISPConfig one that webalizer almost showed twice as many hits as before. So looked at the logs and realised that this was caused by subrequest - the site is heavily using SSI includes. To not log this and not include it in the traffic stats I made this little change to /root/ispconfig/scripts/shell/logs.php. It's a diff against the latest SVN version but also works for older versions (the one I was actually using was ISPConfig-2.2.11).

Hope someone finds this useful.

Code:
43a44
>
75,84d75
<
<               /// hack to exclude requests from own IP
<               ///
<               list($ip) = explode(" ",$normal_log,2);
<               //var_dump($ip);
<               if(in_array($ip,$go_info["isp"]["server_conf"]["ips"])) {
<                       continue;
<               }
<               /// end of hack
<
166c157
< ?>
---
> ?>
\ No newline at end of file
Reply With Quote
Sponsored Links
  #2  
Old 19th May 2007, 14:44
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,743 Times in 2,577 Posts
Default

You can tell Apache to not log hits to specific files. Put something like this into your vhost configuration:

Code:
SetEnvIf        Request_URI "^\/somedir\/somefile.html$" dontlog
where somedir/somefile.html is the file (relative to the vhost's document root) that shouldn't be logged in Apache's access log.

And then you add
Code:
env=!dontlog
at the end of your CustomLog directive, e.g.
Code:
CustomLog "|/usr/bin/cronolog --symlink=/var/log/httpd/access.log /var/log/httpd/access.log_%Y_%m_%d" combined env=!dontlog
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 19th May 2007, 19:26
meemu meemu is offline
Member
 
Join Date: Apr 2007
Posts: 39
Thanks: 2
Thanked 8 Times in 5 Posts
 
Default

The patch is for excluding requests *from* the machine's IP (e.g. subrequests from SSI)
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving server location and new IP's edge Installation/Configuration 2 6th September 2006 11:11


All times are GMT +2. The time now is 06:19.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.