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.
Thread Tools Display Modes
Old 18th May 2007, 14:16
meemu meemu is offline
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.

<               /// 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
< ?>
> ?>
\ No newline at end of file
Reply With Quote
Sponsored Links
Old 19th May 2007, 15:44
falko falko is offline
Super Moderator
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts

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

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
at the end of your CustomLog directive, e.g.
CustomLog "|/usr/bin/cronolog --symlink=/var/log/httpd/access.log /var/log/httpd/access.log_%Y_%m_%d" combined env=!dontlog
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
Old 19th May 2007, 20:26
meemu meemu is offline
Join Date: Apr 2007
Posts: 39
Thanks: 2
Thanked 8 Times in 5 Posts

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


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 12:11

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

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