[BlueOnyx:09727] Re: Solarspeed AWStats on BO/5108R

Steffan general at ziggo.nl
Mon Mar 5 08:55:54 -05 2012


Well its a combination of a old script from the bluequartz

And its not perfect but it works for me  there are 3 files

 

I changed etc/logrotate.conf to rotate daily

 

Im using rsync for backup so I didn't change the line 

 

# use date as a suffix of the rotated file

Dateext

 

I think if you command it out that then you don't have to use the parts
below
you then get access_log.1 etc as it was on 5106 and below

 

 

In my case I didn't find the correct solution for the part below

I do this:

for log in access_log-*
But if there is more then one result then you have a problem, so the first
time do it manually till you only have the log form yesterday

 

awstats_run.sh

#!/bin/sh

echo "`date` - Lets Go"

cd /var/log/httpd

for log in access_log-*

        do

                if [[ $log == *"tar.gz" ]]

                        then

                $b

 

        else

                cp $log /tmp/access_log

                tar -czvf $log.tar.gz $log

                rm $log

        fi

 

        done

#start the next script
/etc/cron.scripts/splitlog.sh


and:

/etc/cron.scripts/splitlog.sh

 


#!/usr/bin/perl

$vhostdir = "/home/tmp/vhosts";

$logfile = "/tmp/access_log";

 

unless(-e $vhostdir && -d $vhostdir){

  mkdir("/home/tmp/vhosts",0755);

}

unless(-e $logfile){

  exit 1;

}

 

%is_open = ();

open(LOGFILE, "$logfile");

while ($log_line = <LOGFILE>) {

$vhost = lc ($vhost) or "access";

    if (! $is_open{$vhost}) {

        open $vhost, ">>$vhostdir/${vhost}"

            or warn ("Can't open ${vhost}");

        $is_open{$vhost} = 1;

}

    $log_line =~ s/^\S*\s+//;

    printf $vhost "%s", $log_line;

}

system("rm $logfile");

system("/etc/cron.scripts/logrun.sh");

exit 0;

 

and;
/etc/cron.scripts/logrun.sh

 

#!/bin/sh

echo "`date` - Lets Go"

 

cd /home/tmp/vhosts

ls -al --sort=s > /home/tmp/sitelist.`date +%Y-%m-%d`

ls -al --sort=s

for a in * ; do

 

        cd /home/sites/$a/logs

        rm web.log

        mv /home/tmp/vhosts/$a web.log

/home/solarspeed/awstats/wwwroot/cgi-bin/awstats.pl -config=$a -update

done

 

 

 

 

Van: blueonyx-bounces at mail.blueonyx.it
[mailto:blueonyx-bounces at mail.blueonyx.it] Namens Richard Morgan
Verzonden: maandag 5 maart 2012 14:26
Aan: BlueOnyx General Mailing List
Onderwerp: [BlueOnyx:09726] Re: Solarspeed AWStats on BO/5108R

 

Hi Steffan

 

Many thanks, I'd love to see if the script sorts it.  Can it be posted to
the list to help out others searching in the future?

 

Your help is appreciated.

 

Regards, Richard

----- Original Message ----- 

From: Steffan <mailto:general at ziggo.nl>  

To: 'BlueOnyx General Mailing List' <mailto:blueonyx at mail.blueonyx.it>  

Sent: Monday, March 05, 2012 10:28 AM

Subject: [BlueOnyx:09725] Re: Solarspeed AWStats on BO/5108R

 

I had the same problem

The problem is that the logs are in date format and the rotation is not
working with that

 

I personly made a little script to correct it

Its not fanxy but it does the job

Happy to share it with you 

 

Steffan

 

Van: blueonyx-bounces at mail.blueonyx.it
[mailto:blueonyx-bounces at mail.blueonyx.it] Namens Richard Morgan
Verzonden: zondag 4 maart 2012 16:23
Aan: BlueOnyx General Mailing List
Onderwerp: [BlueOnyx:09724] Solarspeed AWStats on BO/5108R

 

Hi

 

We moved from BQ to BO/5108R a few days ago... only a few teething problems;
test migrations helped prepare us for this. However...

 

We're using the Solarspeed AWStats package and it's throwing up errors when
the scripts run:

 

zz_awstats-run.pl says 

 

Found old AWStats directory at /home/sites/www.domain.com/awstats 
Moving it to /home/sites/www.domain.com/web/awstats 
/bin/mv: cannot move `/home/sites/www.domain.com/awstats' to
`/home/sites/www.domain.com/web/awstats': Directory not empty

 

There is nothing at /home/sites/www.domain.com/awstats although the existing
data is at /home/sites/www.domain.com/web/awstats

 

Also, when I eventually remove all the security and get it to run, the
header of the page says: Never updated (See 'Build/Update' on
awstats_setup.html page) - all the data is '0' and I can't really see a
solution on the page mentioned.

 

1. Things I've tried: uninstalling/reinstalling the package:
5108R-AWStats-7.0-SOL2.pkg

2. Running /etc/cron.daily/logrotate
3. Running zz_awstats-run.pl

4. Running zzz_awstats-run.pl

 

I'm at the end of my thinking so if anyone has any ideas, it would be hugely
appreciated.

 

Regards, Richard

 

 


Morgan Web
Web: www.morgan-web.co.uk
Email: info at morgan-web.co.uk
Telephone: 01656 741139

 

 

  _____  

_______________________________________________
Blueonyx mailing list
Blueonyx at mail.blueonyx.it
http://mail.blueonyx.it/mailman/listinfo/blueonyx

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.blueonyx.it/pipermail/blueonyx/attachments/20120305/804a9122/attachment.html>


More information about the Blueonyx mailing list