Custom webalizer.conf for each ISPConfig site
Wed, 02/27/2008 - 16:11 — wizapI needed custom configuration for each site to exclude the domain which would otherwise show up in the webalizer referrer report.
I patched "/root/ispconfig/scripts/shell
--- webalizer.php.orig 2008-02-27 13:39:38.000000000 -0600
+++ webalizer.php   ; 2008-02-27 14:26:03.000000000 -0600
@@ -86,6 +86,9 @@
&nbs p; &nbs p; $web_path = $web_home . "/$webname/web";
&nbs p; &nbs p; $stats_path = $web_path . "/stats";
&nbs p; &nbs p; $logfile = $web_home . "/$webname/log/web.log&qu ot;;
+ &nb sp; &nb sp; // Begin: addition by wizap
+ &nb sp; &nb sp; $webalizer_conf = $web_home."/".$webna me."/webalizer.conf" ;
+ &nb sp; &nb sp; // End: by wizap
&nbs p; &nbs p; $web_user = fileowner($web_path);
&nbs p; &nbs p; $web_group = filegroup($web_path);
@@ -144,7 +147,14 @@
&nbs p; &nbs p; &nbs p; } else {
&nbs p; &nbs p; &nbs p; &nbs p; $web_real_name = $web_data["web_domain&quo t;];
&nbs p; &nbs p; &nbs p; }
- &nb sp; &nb sp; &nb sp; $message .= exec("webalizer -n $web_real_name -s $web_real_name -r $web_real_name -q -T -o $stats_path -c /root/ispconfig/scripts/shell/ webalizer.conf $logfile")."\n" ;
+ &nb sp; &nb sp; &nb sp; // Begin: addition by wizap
+ &nb sp; &nb sp; &nb sp; if(@is_file($webalizer_conf)) {
+ &nb sp; &nb sp; &nb sp; &nb sp; $message .= exec("webalizer -n $web_real_name -s $web_real_name -r $web_real_name -q -T -o $stats_path -c $webalizer_conf $logfile")."\n" ;
+ &nb sp; &nb sp; &nb sp; }
+ &nb sp; &nb sp; &nb sp; else {
+ &nb sp; &nb sp; &nb sp; &nb sp; $message .= exec("webalizer -n $web_real_name -s $web_real_name -r $web_real_name -q -T -o $stats_path -c /root/ispconfig/scripts/shell/ webalizer.conf $logfile")."\n" ;
+ &nb sp; &nb sp; &nb sp; }
+ &nb sp; &nb sp; &nb sp; // End: by wizap
&nbs p; &nbs p; }
&nbs p; &nbs p; exec("chown -R $web_user:$web_group $stats_path &> /dev/null");
@@ -249,4 +259,4 @@
}
}
//////////////// LOGSIZE ENDE ////////////////
\ No newline at end of file
+?>
So, now it will detect if there is a custom webalizer.conf file in the sites root directory and include it instead of the default. You can simply copy over the default webalizer.conf file to the site root and add the site name to the HideReferrer section:
HideReferrer <domain.tld>
- wizap's blog
- Login or register to post comments