go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  Start the server
 
Subject: Start the server
Author: AwsEC2
In response to: Update Statistics
Posted on: 09/04/2012 12:20:05 AM


# /etc/init.d/httpd start


Then verify AWStats by url:
http://example1.com/cgi-bin/awstats/awstats.pl



 

> On 09/04/2012 12:15:09 AM AwsEC2 wrote:

/usr/local/awstats/tools/awstats_updateall.pl now 
  -confdir="/etc/awstats/" 
  -awstatsprog="/usr/local/awstats/wwwroot/cgi-bin/awstats.pl"


If you want to periodically run the above update, you can put the script into /ect/cron.d as follows:

List of scripts:
$ ls -l /etc/cron.d
-rw-r--r--  1 root root  47 Jul  7  2008 awstatcronsetup
-rw-r--r--  1 root root 151 Sep  6 23:55 awstats


AWStats cron setup:
$ cat /etc/cron.d/awstatcronsetup

55 23 * * * root /usr/share/awstats/cronsetup



AWStats script setup:
$ cat /usr/share/awstats/cronsetup

#!/bin/bash

hour=`echo $[$RANDOM % 24]`

if [ $hour -gt 9 ]; then
	echo "00 $hour * * * root /usr/share/awstats/awstats_updateall.pl now 
    -awstatsprog=/var/www/cgi-bin/awstats/awstats.pl 
    -configdir=/etc/awstats/ >/dev/null 2>&1" >/etc/cron.d/awstats
else 
	echo "00 0$hour * * * root /usr/share/awstats/awstats_updateall.pl now 
    -awstatsprog=/var/www/cgi-bin/awstats/awstats.pl 
    -configdir=/etc/awstats/ >/dev/null 2>&1" >/etc/cron.d/awstats
fi

/sbin/service crond restart >/dev/null 2>&1



AWStats update cron script:
$ cat /etc/cron.d/awstats

00 18 * * * root /usr/share/awstats/awstats_updateall.pl now 
-awstatsprog=/var/www/cgi-bin/awstats/awstats.pl 
-configdir=/etc/awstats/ >/dev/null 2>&1




Details can be found here:
http://forumeasy.com/forums/thread.jsp?tid=134670661180&fid=javaprof12




References:

 


 
Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
 
Get your own forum today. It's easy and free.