Web Hosting Talk







View Full Version : Webanalizer conf


dlc2000
04-28-2003, 08:50 AM
Hi,

we are using cpanel, a customer can access on conf file of the own webanalizer, it should be in tmp/webanalizer but what is the confing file name?

thank you

Toolz
04-28-2003, 12:58 PM
I was informed a bit back that it was impossible for all individual customers on a shared box to have their own Webalizer config.

dlc2000
04-28-2003, 02:51 PM
Check this out

http://i4net.tv/marticle/get.php?action=getarticle&articleid=22

:)

Toolz
04-28-2003, 03:03 PM
I like it! - I think hosts are going to get hit with requests to install individual webalizer.conf's now... ;)

arif
04-28-2003, 05:57 PM
I've been running individual webalizer.conf's for a long time now. We wrote a script that uses 1 webalizer binary on each conf file to create reports for all sites. A setup script goes in and setups the webalizer.conf file for each domain.

Took about 9 minutes to get it all working :)

dlc2000
04-28-2003, 05:59 PM
ohh and with this post u would share your script with us? :D

arif
04-28-2003, 06:07 PM
Here you go....Now you'll tell people good things about Neon Rain right??? ;)

#!/bin/sh
mkdir /sites/$1/webalizer/
mkdir /sites/$1/web/WebalizerStats/
echo "webalizer -c /sites/$1/webalizer/webalizer.conf" >> /etc/cron.daily/webalizer
cat /sites/neonrain.com/webalizer/webalizer.conf | sed -e "s/neonrain.com/$1
/g" > /var/sites/$1/webalizer/webalizer.conf
webalizer -c /var/sites/$1/webalizer/webalizer.conf

$1 represents the value you put in when running the script, so ./webalizersetup abc.com and abc.com would be what $1 is.

Hope this helps.

ProTechHost
04-29-2003, 10:45 AM
I have a custom script I wrote myself for adding domains and it makes a custom webalizer.conf for the domain also.

arif
04-29-2003, 10:54 AM
Yeah, quite simple! Do you want to post your script to compare?

I just type in my 1 command and it creates the directories, customizes the webalizer.conf, puts everything in cron.daily and runs it so there is a Stats page to start.

ProTechHost
04-29-2003, 11:02 AM
#!/usr/bin/perl

$file = "domains.txt";


open(IN,$file) or die "Error: $file not found\n";
foreach my $line (<IN>)
{
chomp($line);
system "cp sample.com.conf $line.conf";
#open(OUT,">$line.conf") or die "Error: could not open $file.conf\n";
system "perl -pi -e 's/sample.com/$line/g' $line.conf";
print "finished $line.conf";
}

close(IN);
#close(OUT);

This is the webalizer part of my script. It also has another part that is protected code so I cannot post it here ... however with this you can pretty much hack together your script since this is the bulk of it.

It runs in /etc/webalizer

then I have a cron job to run the stats through an sh file

here is the sh file:

!#/bin/sh
mv /usr/local/apache/logs/* /usr/logs
/usr/local/apache/bin/apachectl restart
for i in /etc/webalizer/*.conf; do webalizer -c $i; done
rm -f /usr/logs/*